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
Marco Bubke
flatpak-qt-creator
Commits
c3304116
Commit
c3304116
authored
Apr 07, 2010
by
Christian Kamm
Browse files
QmlJSEditor: Show snippets before other completion options.
Reviewed-by: Erik Verbruggen
parent
4f1d5ce1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmljseditor/qmljscodecompletion.cpp
View file @
c3304116
...
...
@@ -945,6 +945,8 @@ static bool qmlCompletionItemLessThan(const TextEditor::CompletionItem &l, const
return
true
;
else
if
(
r
.
text
.
isEmpty
())
return
false
;
else
if
(
l
.
data
.
isValid
()
!=
r
.
data
.
isValid
())
return
l
.
data
.
isValid
();
else
if
(
l
.
text
.
at
(
0
).
isUpper
()
&&
r
.
text
.
at
(
0
).
isLower
())
return
false
;
else
if
(
l
.
text
.
at
(
0
).
isLower
()
&&
r
.
text
.
at
(
0
).
isUpper
())
...
...
@@ -963,15 +965,14 @@ QList<TextEditor::CompletionItem> CodeCompletion::getCompletions()
// Remove duplicates
QString
lastKey
;
QVariant
lastData
;
QList
<
TextEditor
::
CompletionItem
>
uniquelist
;
foreach
(
const
TextEditor
::
CompletionItem
&
item
,
completionItems
)
{
if
(
item
.
text
!=
lastKey
)
{
if
(
item
.
text
!=
lastKey
||
item
.
data
.
type
()
!=
lastData
.
type
()
)
{
uniquelist
.
append
(
item
);
lastKey
=
item
.
text
;
}
else
{
if
(
item
.
data
.
canConvert
<
QString
>
())
uniquelist
.
append
(
item
);
lastData
=
item
.
data
;
}
}
...
...
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