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
49167555
Commit
49167555
authored
Jun 18, 2010
by
Erik Verbruggen
Browse files
Added snippet expansion to the C++ code completion.
parent
2ad794c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
49167555
...
...
@@ -1623,8 +1623,17 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
{
Symbol
*
symbol
=
0
;
if
(
item
.
data
.
isValid
())
symbol
=
item
.
data
.
value
<
Symbol
*>
();
if
(
item
.
data
.
isValid
())
{
if
(
item
.
data
.
canConvert
<
QString
>
())
{
TextEditor
::
BaseTextEditor
*
edit
=
qobject_cast
<
TextEditor
::
BaseTextEditor
*>
(
m_editor
->
widget
());
QTextCursor
tc
=
edit
->
textCursor
();
tc
.
setPosition
(
m_startPosition
,
QTextCursor
::
KeepAnchor
);
edit
->
insertCodeSnippet
(
tc
,
item
.
data
.
toString
());
return
;
}
else
{
symbol
=
item
.
data
.
value
<
Symbol
*>
();
}
}
QString
toInsert
;
QString
extraChars
;
...
...
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