Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
942f5a70
Commit
942f5a70
authored
Mar 04, 2009
by
Roberto Raggi
Browse files
Ignore the symbol's column for generated symbols (at least for now).
parent
4613da1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
942f5a70
...
...
@@ -137,7 +137,7 @@ protected:
}
// end of anonymous namespace
QualifiedNameId
*
qualifiedNameIdForSymbol
(
Symbol
*
s
,
const
LookupContext
&
context
)
static
QualifiedNameId
*
qualifiedNameIdForSymbol
(
Symbol
*
s
,
const
LookupContext
&
context
)
{
Name
*
symbolName
=
s
->
name
();
if
(
!
symbolName
)
...
...
@@ -433,12 +433,18 @@ void CPPEditor::updateMethodBoxIndex()
if
(
file
()
->
fileName
()
!=
symbol
->
fileName
())
continue
;
else
if
(
symbol
->
isGenerated
())
continue
;
if
(
symbol
)
{
int
column
=
symbol
->
column
();
if
(
column
!=
0
)
--
column
;
if
(
symbol
->
isGenerated
())
column
=
0
;
QTextCursor
c
(
document
()
->
findBlockByNumber
(
symbol
->
line
()
-
1
));
c
.
setPosition
(
c
.
position
()
+
column
);
...
...
@@ -969,7 +975,8 @@ bool CPPEditor::openEditorAt(Symbol *s)
if
(
column
)
--
column
;
#else
unsigned
column
=
0
;
if
(
s
->
isGenerated
())
unsigned
column
=
0
;
#endif
return
openCppEditorAt
(
fileName
,
s
->
line
(),
column
);
...
...
src/shared/cplusplus/Symbol.cpp
View file @
942f5a70
...
...
@@ -164,7 +164,8 @@ Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, Name *
_visibility
(
Symbol
::
Public
),
_scope
(
0
),
_index
(
0
),
_next
(
0
)
_next
(
0
),
_isGenerated
(
false
)
{
setSourceLocation
(
sourceLocation
);
setName
(
name
);
...
...
@@ -200,14 +201,24 @@ unsigned Symbol::sourceLocation() const
unsigned
Symbol
::
sourceOffset
()
const
{
return
_sourceOffset
;
}
bool
Symbol
::
isGenerated
()
const
{
return
_isGenerated
;
}
void
Symbol
::
setSourceLocation
(
unsigned
sourceLocation
)
{
_sourceLocation
=
sourceLocation
;
if
(
_sourceLocation
)
_sourceOffset
=
translationUnit
()
->
tokenAt
(
sourceLocation
).
offset
;
else
if
(
!
_sourceLocation
)
{
_isGenerated
=
false
;
_sourceOffset
=
0
;
}
else
{
TranslationUnit
*
unit
=
translationUnit
();
const
Token
&
tk
=
unit
->
tokenAt
(
sourceLocation
);
_isGenerated
=
tk
.
generated
;
_sourceOffset
=
tk
.
offset
;
}
}
unsigned
Symbol
::
line
()
const
...
...
src/shared/cplusplus/Symbol.h
View file @
942f5a70
...
...
@@ -233,6 +233,8 @@ public:
Name
*
identity
()
const
;
bool
isGenerated
()
const
;
void
setScope
(
Scope
*
scope
);
// ### make me private
void
setSourceLocation
(
unsigned
sourceLocation
);
// ### make me private
...
...
@@ -256,6 +258,8 @@ private:
unsigned
_index
;
Symbol
*
_next
;
bool
_isGenerated
:
1
;
class
IdentityForName
;
class
HashCode
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment