Commit Graph

57 Commits

Author SHA1 Message Date
Christian Kamm
8de03ac2dd QmlJS: Fix code completion when no semantic info is available. 2010-08-30 14:49:58 +02:00
Christian Kamm
32bb7bffc0 QmlJS: Add missing null checks before using scopeChain().qmlTypes. 2010-08-30 13:35:35 +02:00
Christian Kamm
87e04df257 QmlJS: Refactor LookupContext creation for speed.
* If possible, create LookupContexts through SemanticInfo; it caches the
  linked Context and will be faster.
* Contexts now own their Engine.

Reviewed-by: Lasse Holmstedt
2010-08-26 11:34:29 +02:00
Christian Kamm
898098c1f2 QmlJS: Allow lookups on const Contexts. Pass const Contexts where ok.
In preparation for caching Contexts.

Reviewed-by: Erik Verbruggen
2010-08-25 11:53:23 +02:00
Thorbjørn Lindeijer
e101d8eccc Make the way completion is triggered configurable
Now it's possible to choose between having completion popup manually,
when triggered or always.
2010-07-15 16:24:01 +02:00
Thorbjørn Lindeijer
b4cecd6ec8 Allow certain characters to also trigger the completion
Now you can type characters like ., ( and : to complete the selected
item, depending on the type of the completion item.

Task-number: QTCREATORBUG-271
Reviewed-by: Roberto Raggi
2010-07-09 15:52:09 +02:00
Roberto Raggi
d70fe1eb61 Introduced QmlJS::LookupContext. 2010-07-08 14:50:25 +02:00
con
ede2a7c975 Merge remote branch 'origin/2.0'
Conflicts:
	doc/qtcreator.qdoc
	share/qtcreator/gdbmacros/dumper.py
	src/libs/qmljs/qmljs-lib.pri
	src/plugins/debugger/breakhandler.cpp
	src/plugins/projectexplorer/projectexplorer.h
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.h
2010-06-30 14:25:09 +02:00
Christian Kamm
01a5953575 QmlJS: Fix slots not being offered for completion. 2010-06-28 10:14:13 +02:00
Christian Kamm
123607ad70 QmlJS: Make variables in imported JS documents show up in completion.
Filtering them out has long since become unnecessary. It was used back
when JS files were sourced from Script elements - there they'd only
make the functions available. Now functions and variables are imported.

Task-number: QTCREATORBUG-1735
Reviewed-by: Erik Verbruggen
2010-06-25 13:34:45 +02:00
Christian Kamm
6cf98e281a QmlJS: Change completion ordering to put properties above snippets.
Task-number: QTCREATORBUG-1715
2010-06-24 10:34:07 +02:00
Christian Kamm
c7c7e52cf6 QmlJS: Fix explicit ordering of code completion items.
The relevance member is already used by the CompletionCollector. Instead
I introduced the 'order' member to store a value used for the sorting
of completion items.

Reviewed-by: Erik Verbruggen
2010-06-24 10:34:07 +02:00
con
458a25efa9 Merge remote branch 'origin/2.0'
Conflicts:
	doc/qt-html-templates.qdocconf
	src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
	src/plugins/qmljseditor/qmljscodecompletion.cpp
2010-06-18 16:54:37 +02:00
Thorbjørn Lindeijer
16989185df Prefer static to anonymous namespace for global functions 2010-06-16 17:43:46 +02:00
Thorbjørn Lindeijer
173cdff56c Merge branch '2.0'
Conflicts:
	src/plugins/cppeditor/cppquickfix.cpp
	src/plugins/mercurial/mercurialjobrunner.cpp
	src/plugins/subversion/subversionplugin.cpp
2010-06-15 13:22:33 +02:00
Thorbjørn Lindeijer
a6e5298591 Fixed handling of text wrapping and a text layout corner case
Due to using QTextCursor::columnNumber() instead of
QTextCursor::positionInBlock(), a lot of code would not work correctly
when used with wrapped lines.

In addition, there was an issue with columnNumber() returning 0 right
after inserting a character before the last character of a line.

Reviewed-by: mae
2010-06-15 12:25:01 +02:00
Erik Verbruggen
05639e4688 Merge branch 'origin/2.0' (early part) 2010-06-15 11:30:51 +02:00
Thorbjørn Lindeijer
6875a50d27 Don't pass QChar as const & since it's just a unsigned short
Reviewed-by: ogoffart
2010-06-14 16:10:35 +02:00
Roberto Raggi
726c3345c4 Moved qmljsmodelmanagerinterface.h 2010-06-10 11:59:27 +02:00
Christian Kamm
373bfb05e7 QmlJS: On completion, avoid adding : or . again if already present. 2010-06-10 11:33:04 +02:00
Christian Kamm
4f6dc35af8 QmlJS: Make ordering in the completion list simpler to change. 2010-06-10 11:33:04 +02:00
Christian Kamm
02cc2177a3 QmlJS: Add completion for "id:". 2010-06-10 11:33:04 +02:00
Christian Kamm
019ff9d06b QmlJS: Don't append colons when completing namespaced types.
Task-number: QTCREATORBUG-1604
2010-06-08 15:43:08 +02:00
Christian Kamm
d7747fe849 QmlJS: Trigger another completion if a completion ends with a dot. 2010-06-07 17:37:45 +02:00
Christian Kamm
3b8b6e89cc QmlJS: Autocomplete dot and colon for properties.
Reviewed-by: Roberto Raggi
2010-06-07 17:37:45 +02:00
Christian Kamm
62141475e3 QmlJS: Potentially fix hard-to-reproduce crash in JS completion.
* Context::build was potentially dangerous. Link and ScopeBuilder
  went out of scope before their results stopped being used.
* ScopeBuilder: If no function scope object was found, don't add it.

Reviewed-by: Erik Verbruggen
2010-05-19 14:23:08 +02:00
Christian Kamm
088bdb29db QmlJS: Provide good completion for PropertyChanges with a target again.
Task-number: QTCREATORBUG-1413
Reviewed-by: Erik Verbruggen
2010-05-19 11:15:57 +02:00
Christian Kamm
9b7d3e5531 QmlJSEditor: Remove 'readonly' Qml keyword from completion.
It is unused at the moment.
2010-05-19 10:40:00 +02:00
Christian Kamm
eb53e71d95 QmlJSEditor: Simplify Qml completion code. 2010-05-19 10:38:09 +02:00
Christian Kamm
28ec223314 QmlJS: Fix completion for grouped property bindings.
Task-number: QTCREATORBUG-1388
Reviewed-by: Roberto Raggi
2010-05-12 14:11:23 +02:00
Thorbjørn Lindeijer
e53b5bc9a1 Fixed completion settings to also apply to the QML code completion
By moving the completion settings into the TextEditor plugin, so that
both the CppTools and the QmlJSEditor plugins can access the settings.

The user-interface to edit the settings is still in the CppTools plugin,
since we're in string freeze at the moment. It should be moved to the
TextEditor plugin later.

For now the QML completion only supports the case-sensitivity and
partial completion options, since there is no automatic insertion of
brackets.

Task-number: QTCREATORBUG-1327
Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
2010-05-11 15:11:12 +02:00
Christian Kamm
44a155c612 QmlJS: Fix completion context when cursor is to the right of inserted ;
Done-with: Erik Verbruggen
2010-04-30 14:22:55 +02:00
Christian Kamm
0e12240613 QmlJS: Completion for enums.
Done-with: Erik Verbruggen
2010-04-29 16:05:25 +02:00
Christian Kamm
a48032b616 QmlJS: Improve completion for object bindings with 'on'.
Done-with: Erik Verbruggen
2010-04-29 16:05:25 +02:00
Christian Kamm
f48df24737 QmlJS: Improve property and Type completion in Qml object members.
Done-with: Erik Verbruggen
2010-04-29 16:05:24 +02:00
Christian Kamm
722ba33770 QmlJS: Add CompletionContextFinder to allow context sensitive completion
The plan is to use this to reduce the number of applicable
completion options, for instance for enum completion or property
names.

Done-with: Erik Verbruggen
2010-04-29 16:05:24 +02:00
Thorbjørn Lindeijer
41ab8fbbf1 Moved TextEditDocumentLayout and related classes to their own file
The Parentheses, TextBlockUserData and TextEditDocumentLayout classes
and their member function implementations were spread around the
BaseTextEditor class. Moving them to their own file to make the code a
bit better organized.

Reviewed-by: mae
2010-04-26 14:42:11 +02:00
Thorbjørn Lindeijer
20636f529b Unified the three fake tooltip copies
Reviewed-by: mae
2010-04-15 15:08:51 +02:00
mae
0c7312e05d if a tooltip, do as tooltip do
The fake tooltip duplication is not nice.
2010-04-09 13:48:43 +02:00
mae
8eedde33c5 Implement tooltips for snippets 2010-04-09 12:59:49 +02:00
Christian Kamm
c330411604 QmlJSEditor: Show snippets before other completion options.
Reviewed-by: Erik Verbruggen
2010-04-07 11:09:27 +02:00
Erik Verbruggen
7c4eb002e2 Fixed corner cases for comparison.
Reviewed-by: ckamm
2010-04-06 10:42:48 +02:00
mae
65e3017edf minor code cosmetics 2010-03-30 14:57:59 +02:00
mae
91dac9385e Re-enable snippets
Fixed colors to use the same as refactoring rename, and a few
fixes for undo and document changes outside the tab areas.

Reviewed-by: Roberto Raggi
2010-03-29 16:45:41 +02:00
Roberto Raggi
4ee8a199af Introduced Document::isQmlDocument() and Document::isJSDocument(). 2010-03-29 12:56:25 +02:00
Roberto Raggi
7c04d11f44 Automagically hide the completion box when the text under cursor matches the only item in the completion box. 2010-03-29 10:49:21 +02:00
Roberto Raggi
cbf1fe8c3a Fixed possible crash when using completion when completing code in invalid documents. 2010-03-29 10:45:18 +02:00
Christian Kamm
81e74d23a3 QmlJSEditor: Set an icon for keyword completions. 2010-03-26 14:17:03 +01:00
Christian Kamm
b2bb919e45 QmlJSEditor: Add completion for JS keywords and Qml reserved words.
Task-number: QTCREATORBUG-919
Reviewed-by: Roberto Raggi
2010-03-26 13:51:46 +01:00
Christian Kamm
9ea01cf5fb Improve Qml code model import handling.
* Fill the snapshot with files that could be imported.
* Implement package imports.

* The qmldir file is not parsed yet.

Reviewed-by: Erik Verbruggen
2010-03-18 11:25:37 +01:00