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
55175c14
Commit
55175c14
authored
Dec 07, 2009
by
Roberto Raggi
Browse files
Fixed scope completion after a template-id. For example, when completing std::list<int>::i...
parent
44f29afc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/ExpressionUnderCursor.cpp
View file @
55175c14
...
@@ -46,6 +46,13 @@ ExpressionUnderCursor::~ExpressionUnderCursor()
...
@@ -46,6 +46,13 @@ ExpressionUnderCursor::~ExpressionUnderCursor()
int
ExpressionUnderCursor
::
startOfExpression
(
BackwardsScanner
&
tk
,
int
index
)
int
ExpressionUnderCursor
::
startOfExpression
(
BackwardsScanner
&
tk
,
int
index
)
{
{
if
(
tk
[
index
-
1
].
is
(
T_GREATER
))
{
const
int
matchingBraceIndex
=
tk
.
startOfMatchingBrace
(
index
);
if
(
tk
[
matchingBraceIndex
-
1
].
is
(
T_IDENTIFIER
))
index
=
matchingBraceIndex
-
1
;
}
index
=
startOfExpression_helper
(
tk
,
index
);
index
=
startOfExpression_helper
(
tk
,
index
);
if
(
_jumpedComma
)
{
if
(
_jumpedComma
)
{
...
@@ -148,11 +155,11 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
...
@@ -148,11 +155,11 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
}
}
return
index
-
1
;
return
index
-
1
;
}
else
if
(
tk
[
index
-
1
].
is
(
T_RPAREN
))
{
}
else
if
(
tk
[
index
-
1
].
is
(
T_RPAREN
))
{
int
rparen
Index
=
tk
.
startOfMatchingBrace
(
index
);
int
matchingBrace
Index
=
tk
.
startOfMatchingBrace
(
index
);
if
(
rparen
Index
!=
index
)
{
if
(
matchingBrace
Index
!=
index
)
{
if
(
tk
[
rparen
Index
-
1
].
is
(
T_GREATER
))
{
if
(
tk
[
matchingBrace
Index
-
1
].
is
(
T_GREATER
))
{
int
lessIndex
=
tk
.
startOfMatchingBrace
(
rparen
Index
);
int
lessIndex
=
tk
.
startOfMatchingBrace
(
matchingBrace
Index
);
if
(
lessIndex
!=
rparen
Index
-
1
)
{
if
(
lessIndex
!=
matchingBrace
Index
-
1
)
{
if
(
tk
[
lessIndex
-
1
].
is
(
T_DYNAMIC_CAST
)
||
if
(
tk
[
lessIndex
-
1
].
is
(
T_DYNAMIC_CAST
)
||
tk
[
lessIndex
-
1
].
is
(
T_STATIC_CAST
)
||
tk
[
lessIndex
-
1
].
is
(
T_STATIC_CAST
)
||
tk
[
lessIndex
-
1
].
is
(
T_CONST_CAST
)
||
tk
[
lessIndex
-
1
].
is
(
T_CONST_CAST
)
||
...
@@ -166,7 +173,7 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
...
@@ -166,7 +173,7 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
return
startOfExpression
(
tk
,
lessIndex
);
return
startOfExpression
(
tk
,
lessIndex
);
}
}
}
}
return
startOfExpression
(
tk
,
rparen
Index
);
return
startOfExpression
(
tk
,
matchingBrace
Index
);
}
}
return
index
;
return
index
;
}
else
if
(
tk
[
index
-
1
].
is
(
T_RBRACKET
))
{
}
else
if
(
tk
[
index
-
1
].
is
(
T_RBRACKET
))
{
...
...
Write
Preview
Markdown
is supported
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