Skip to content
GitLab
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
7105b773
Commit
7105b773
authored
Oct 08, 2009
by
Roberto Raggi
Browse files
Enable completion in C++ ctor-initializers. For example,
struct foo { int m_zoo; foo(): m_ // cursor is here.
parent
6bcfee48
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
7105b773
...
...
@@ -640,6 +640,14 @@ static int startOfOperator(TextEditor::ITextEditable *editor,
}
}
if
(
k
==
T_COMMA
)
{
ExpressionUnderCursor
expressionUnderCursor
;
if
(
expressionUnderCursor
.
startOfFunctionCall
(
tc
)
==
-
1
)
{
k
=
T_EOF_SYMBOL
;
start
=
pos
;
}
}
static
CPlusPlus
::
TokenUnderCursor
tokenUnderCursor
;
const
SimpleToken
tk
=
tokenUnderCursor
(
tc
);
...
...
@@ -783,11 +791,14 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
if
(
m_completionOperator
==
T_COMMA
)
{
tc
.
setPosition
(
endOfExpression
);
const
int
start
=
expressionUnderCursor
.
startOfFunctionCall
(
tc
);
if
(
start
!=
-
1
)
{
endOfExpression
=
start
;
m_startPosition
=
start
+
1
;
m_completionOperator
=
T_LPAREN
;
if
(
start
==
-
1
)
{
m_completionOperator
=
T_EOF_SYMBOL
;
return
-
1
;
}
endOfExpression
=
start
;
m_startPosition
=
start
+
1
;
m_completionOperator
=
T_LPAREN
;
}
QString
expression
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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