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
44a155c6
Commit
44a155c6
authored
Apr 30, 2010
by
Christian Kamm
Browse files
QmlJS: Fix completion context when cursor is to the right of inserted ;
Done-with: Erik Verbruggen
parent
0970a8e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljscompletioncontextfinder.cpp
View file @
44a155c6
...
...
@@ -31,6 +31,9 @@ CompletionContextFinder::CompletionContextFinder(const QTextCursor &cursor)
break
;
}
if
(
m_startTokenIndex
==
yyLinizerState
.
tokens
.
size
()
-
1
&&
yyLinizerState
.
insertedSemicolon
)
--
m_startTokenIndex
;
getQmlObjectTypeName
(
m_startTokenIndex
);
checkBinding
();
}
...
...
src/libs/qmljs/qmljslineinfo.cpp
View file @
44a155c6
...
...
@@ -208,6 +208,7 @@ QString LineInfo::trimmedCodeLine(const QString &t)
const
Token
sc
(
trimmed
.
size
(),
1
,
Token
::
Semicolon
);
yyLinizerState
.
tokens
.
append
(
sc
);
trimmed
.
append
(
QLatin1Char
(
';'
));
yyLinizerState
.
insertedSemicolon
=
true
;
}
}
...
...
@@ -276,6 +277,8 @@ bool LineInfo::readLine()
(
firstNonWhiteSpace
(
yyLinizerState
.
line
)
==
QLatin1Char
(
'{'
));
do
{
yyLinizerState
.
insertedSemicolon
=
false
;
if
(
yyLinizerState
.
iter
==
yyProgram
.
firstBlock
())
{
yyLinizerState
.
line
.
clear
();
return
false
;
...
...
@@ -332,6 +335,7 @@ void LineInfo::startLinizer()
{
yyLinizerState
.
braceDepth
=
0
;
yyLinizerState
.
pendingRightBrace
=
false
;
yyLinizerState
.
insertedSemicolon
=
false
;
yyLine
=
&
yyLinizerState
.
line
;
yyBraceDepth
=
&
yyLinizerState
.
braceDepth
;
...
...
src/libs/qmljs/qmljslineinfo.h
View file @
44a155c6
...
...
@@ -84,12 +84,14 @@ protected:
LinizerState
()
:
braceDepth
(
0
),
leftBraceFollows
(
false
),
pendingRightBrace
(
false
)
pendingRightBrace
(
false
),
insertedSemicolon
(
false
)
{
}
int
braceDepth
;
bool
leftBraceFollows
;
bool
pendingRightBrace
;
bool
insertedSemicolon
;
QString
line
;
QList
<
Token
>
tokens
;
QTextBlock
iter
;
...
...
src/plugins/qmljseditor/qmljscodecompletion.cpp
View file @
44a155c6
...
...
@@ -690,7 +690,6 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
if
(
contextFinder
.
isInRhsOfBinding
()
&&
qmlScopeType
)
{
doQmlKeywordCompletion
=
false
;
qDebug
()
<<
"property name: "
<<
contextFinder
.
bindingPropertyName
();
if
(
!
contextFinder
.
bindingPropertyName
().
isEmpty
())
{
const
Interpreter
::
Value
*
value
=
qmlScopeType
;
...
...
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