Commit Graph

153 Commits

Author SHA1 Message Date
Christian Kamm
5a7858f5ec Make sure the BackwardScanner has tokenized before asking for a string.
The problem was that for

Foo::Foo
(|)

when the user triggers completion at |, startOfLine() returns a token
that's not on the current line and not yet tokenized by that instance
of the BackwardScanner.

As a fix I explicitly ask the instance to tokenize up to the given
index.

Task-number: QTCREATORBUG-673
Reviewed-by: Roberto Raggi
2010-03-11 11:09:04 +01:00
Christian Kamm
9e75ff8ea2 Don't add the default arguments when completing function definitions.
Fixes QTCREATORBUG-787

Reviewed-by: Erik Verbruggen
2010-03-05 15:45:58 +01:00
hjk
9595504bda Long live the king! 2010-03-05 11:28:13 +01:00
Erik Verbruggen
2fee6b8a46 Fixed QTCREATORBUG-743 2010-02-22 17:34:06 +01:00
Erik Verbruggen
8de6ccc775 Revert "Split Objective-C keyword parsing to handle the '@' separately."
This reverts commit 2a59d2ae0c.
2010-02-15 12:24:31 +01:00
Erik Verbruggen
2a59d2ae0c Split Objective-C keyword parsing to handle the '@' separately.
Because apparently, while designing the Objective-C language, somebody
thought it was a world-class idea to allow any white-space between the
'@' character and the subsequent keyword. With this fix, we now
correctly parse:
    @  dynamic
and:
    @
      selector
and:
    @"foo"
     "bar"
    @"mooze"
(This last one is 1 single string split over multiple lines.)
Wonderful, isn't it?

What we (and Clang) do not support, but what GCC supports is something
like:
   @"foo"@@  "bar"  @"mooze"  @@
which is equivalent to @"foobarmooze".
2010-02-15 09:27:00 +01:00
Friedemann Kleint
f672bff338 Fix some code scanning issues.
foreach()-Loops.
2010-02-01 14:00:07 +01:00
Roberto Raggi
1ba889a1bf Generalized the filtering of completion items. 2010-01-26 11:44:45 +01:00
Thorbjørn Lindeijer
49d511502f Fixed compile warning 2010-01-20 17:58:49 +01:00
Thorbjørn Lindeijer
f3b738bb66 Reuse local snapshot reference 2010-01-14 11:54:11 +01:00
con
7199223a6e Merge remote branch 'origin/1.3'
Conflicts:
	doc/qtcreator.qdoc
	doc/qtcreator.qdocconf
	src/app/Info.plist
	src/plugins/bineditor/BinEditor.pluginspec
	src/plugins/bookmarks/Bookmarks.pluginspec
	src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec
	src/plugins/coreplugin/Core.pluginspec
	src/plugins/coreplugin/coreconstants.h
	src/plugins/cpaster/CodePaster.pluginspec
	src/plugins/cppeditor/CppEditor.pluginspec
	src/plugins/cppeditor/cppeditor.cpp
	src/plugins/cpptools/CppTools.pluginspec
	src/plugins/cvs/CVS.pluginspec
	src/plugins/debugger/Debugger.pluginspec
	src/plugins/debugger/debuggeragents.cpp
	src/plugins/debugger/gdb/gdbengine.cpp
	src/plugins/designer/Designer.pluginspec
	src/plugins/fakevim/FakeVim.pluginspec
	src/plugins/find/Find.pluginspec
	src/plugins/genericprojectmanager/GenericProjectManager.pluginspec
	src/plugins/git/ScmGit.pluginspec
	src/plugins/helloworld/HelloWorld.pluginspec
	src/plugins/help/Help.pluginspec
	src/plugins/locator/Locator.pluginspec
	src/plugins/perforce/Perforce.pluginspec
	src/plugins/projectexplorer/ProjectExplorer.pluginspec
	src/plugins/qmleditor/QmlEditor.pluginspec
	src/plugins/qmleditor/idcollector.cpp
	src/plugins/qmleditor/idcollector.h
	src/plugins/qmleditor/parser/qmljsglobal_p.h
	src/plugins/qmleditor/qmlcodecompletion.cpp
	src/plugins/qmleditor/qmlcodeformatter.cpp
	src/plugins/qmleditor/qmlcodeformatter.h
	src/plugins/qmleditor/qmlexpressionundercursor.cpp
	src/plugins/qmleditor/qmllookupcontext.cpp
	src/plugins/qmleditor/qmlresolveexpression.cpp
	src/plugins/qmleditor/qmlsymbol.cpp
	src/plugins/qmleditor/qmlsymbol.h
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec
	src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec
	src/plugins/qtscripteditor/QtScriptEditor.pluginspec
	src/plugins/regexp/RegExp.pluginspec
	src/plugins/resourceeditor/ResourceEditor.pluginspec
	src/plugins/snippets/Snippets.pluginspec
	src/plugins/subversion/Subversion.pluginspec
	src/plugins/texteditor/TextEditor.pluginspec
	src/plugins/vcsbase/VCSBase.pluginspec
	src/plugins/welcome/Welcome.pluginspec
	src/shared/qml/parser/qmljsast.cpp
	src/shared/qml/parser/qmljsast_p.h
	src/shared/qml/parser/qmljsastfwd_p.h
	src/shared/qml/parser/qmljsastvisitor.cpp
	src/shared/qml/parser/qmljsastvisitor_p.h
	src/shared/qml/parser/qmljsengine_p.cpp
	src/shared/qml/parser/qmljsengine_p.h
	src/shared/qml/parser/qmljsgrammar.cpp
	src/shared/qml/parser/qmljsgrammar_p.h
	src/shared/qml/parser/qmljslexer.cpp
	src/shared/qml/parser/qmljslexer_p.h
	src/shared/qml/parser/qmljsmemorypool_p.h
	src/shared/qml/parser/qmljsnodepool_p.h
	src/shared/qml/parser/qmljsparser.cpp
	src/shared/qml/parser/qmljsparser_p.h
2010-01-12 18:02:04 +01:00
Roberto Raggi
3ec38cbe5b Keep the snapshot around when performing a global completion 2010-01-12 12:31:27 +01:00
Roberto Raggi
421f5323f1 Split CppCodeCompletion::startCompletion(). 2010-01-11 14:08:15 +01:00
Thorbjørn Lindeijer
aeaaa39225 Use the completion case sensitivity settings also for relevance
Avoids some annoyance for people using case-sensitive completion, when
unrelated completions items would get higher relevance because they
start with the typed string when matched case-insensitively.

In case-insensitive mode, a case-sensitive prefix match now does get a
higher relevance than a case-insensitive match.

Reviewed-by: con
2010-01-07 15:42:08 +01:00
Thorbjørn Lindeijer
46e612761f Be smarter about CamelCase when doing case-insensitive completion
Even when an upper case character can also match a lower case one, it
should only be treated as a CamelCase match when the matched character
is also upper case. This avoids some false positives.

Also, the part that allows a word in a CamelCase identifier to be
truncated should never be matched case-insensitively.
2009-12-11 14:38:28 +01:00
Roberto Raggi
f03ce847db Search symbols also in enum scopes. 2009-12-10 10:24:31 +01:00
Thorbjørn Lindeijer
3f1b45b057 Implemented first-letter case-sensitive for completion as default
By default now only the first letter is case-sensitive. It is still
possible to choose full or no case-sensitivity as well.

Task-number: QTCREATORBUG-236
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2009-12-09 19:26:34 +01:00
Roberto Raggi
3d2e454358 Add only symbols declared in class scopes when performing class-completion. 2009-12-08 12:43:40 +01:00
Roberto Raggi
14376c3c32 Initial work on the new CPlusPlus::Snapshot.
Encapsulate the details.
2009-12-07 10:54:27 +01:00
Roberto Raggi
f3bebd7f1b Moved Completion::getCompletion() in ICompletionCollector and made the filtering of completion items more C++ friendly. 2009-12-02 12:18:12 +01:00
Roberto Raggi
7c7ce13ac0 Use const names. 2009-12-01 12:46:23 +01:00
Oswald Buddenhagen
913f6161a1 Merge remote branch 'origin/1.3'
Conflicts:
	src/plugins/cpptools/cppcodecompletion.cpp
	src/plugins/help/helpplugin.cpp
	src/plugins/projectexplorer/projectexplorer.cpp
2009-11-20 17:25:39 +01:00
Thorbjørn Lindeijer
2e82c14abc Fixed function argument widget text color in dark themes
By setting the window and button text colors to the tool tip text color,
since a tool tip background is drawn.

Task-number: QTCREATORBUG-322
2009-11-20 16:40:30 +01:00
Thorbjørn Lindeijer
69969bef43 Fixed possible crash on constructor completion
When constructor completion was attempted on a base class specified in a
class declaration, a null pointer reference would occur.

Task-number: QTCREATORBUG-321
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2009-11-19 17:29:37 +01:00
Roberto Raggi
ecf40d2426 Get rid off QPair<FullySpecifiedType, Symbol *>. Use LookupItem intead. 2009-11-17 14:24:09 +01:00
Roberto Raggi
c13b8697d2 Introduced the quick fix engine 2009-11-13 16:14:38 +01:00
Roberto Raggi
0ae2d96a9b Fixed the AST field names. 2009-11-10 16:47:16 +01:00
Roberto Raggi
24b6c858eb Cleanup postfix declarators. 2009-11-10 16:20:12 +01:00
Roberto Raggi
6e3e293e53 Removed DeclaratorListAST
Done with Erik Verbruggen
2009-11-10 16:20:10 +01:00
con
36d0d8500e Merge commit 'origin/1.3' 2009-11-09 11:36:19 +01:00
Christian Kamm
a253a69980 Do never offer signature autocompletion for constructor calls.
They should always use the function parameter tooltip.

This fixes a bug where you were offered completion for
C foo( -> C foo(int x)
if C had a constructor taking int x.

Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
2009-11-09 10:13:17 +01:00
con
c8bb7e174b Merge commit 'origin/1.3'
Conflicts:
	src/plugins/qt4projectmanager/qt4project.cpp
2009-11-04 19:15:14 +01:00
Roberto Raggi
f2a0382910 Replace . with -> only when the base expression has type pointer to class.
Reviewed-by: Thorbjørn Lindeijer
2009-11-04 18:21:35 +01:00
con
fa34847571 Merge commit 'origin/1.3'
Conflicts:
	src/plugins/debugger/gdb/gdbengine.cpp
	src/plugins/qt4projectmanager/qt4project.cpp
2009-11-03 18:08:01 +01:00
Christian Kamm
ff4e559c46 Improve completion for function declarations.
Instead of just completing
void A::foo(|) -> void A::foo(int i|), we now complete
void A::foo(|) -> void A::foo(int i) const|
where | represents the place of the cursor.

Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
2009-11-02 10:32:50 +01:00
con
441ece365a Merge commit 'origin/1.3'
Conflicts:
	src/plugins/cpptools/cppcodecompletion.h
	src/plugins/debugger/gdb/gdbengine.cpp
	src/plugins/qmleditor/QmlEditor.pluginspec
2009-10-26 13:51:56 +01:00
Roberto Raggi
996866814a Initialize all the members of CppCodeCompletion 2009-10-21 17:05:36 +02:00
Oswald Buddenhagen
c9f9310bb1 Merge remote branch 'origin/1.3'
Conflicts:
	src/plugins/cpptools/cppcodecompletion.cpp
	src/plugins/debugger/gdb/remotegdbadapter.cpp
2009-10-20 20:09:00 +02:00
Roberto Raggi
1006be240d Fixed possible crash when completing top-level declarations. 2009-10-20 17:17:11 +02:00
Roberto Raggi
41139ef630 Don't acticate completion inside C++-like comments. 2009-10-20 16:37:23 +02:00
Christian Kamm
cadaec24aa Fix function signature completion for cv-qualified functions.
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2009-10-20 12:55:14 +02:00
Christian Kamm
e3479d9942 Add completion for function signatures.
You now get the function parameters as a completion suggestion when
declaring or defining a function. The tooltip for function calls
is unchanged.

Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
(cherry picked from commit 202fef42ca)
2009-10-20 12:55:14 +02:00
Christian Kamm
202fef42ca Add completion for function signatures.
You now get the function parameters as a completion suggestion when
declaring or defining a function. The tooltip for function calls
is unchanged.

Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2009-10-19 14:19:28 +02:00
con
525ef4cc85 Merge remote branch 'origin/1.3'
Conflicts:
	src/plugins/cpptools/CppTools.pluginspec
	src/plugins/help/Help.pluginspec
	src/plugins/locator/Locator.pluginspec
	src/plugins/projectexplorer/ProjectExplorer.pluginspec
	src/plugins/texteditor/TextEditor.pluginspec
2009-10-16 14:40:40 +02:00
Roberto Raggi
8b514657cc Added support to complete function-call operators. 2009-10-16 12:23:16 +02:00
Roberto Raggi
8dc369bc2d Simplified member completion.
Share code with ResolveExpression.
2009-10-16 11:08:34 +02:00
Erik Verbruggen
4b44fa5f4a Added Objective-C @-keywords to the completion. 2009-10-09 15:22:57 +02:00
Roberto Raggi
510f8ccc3d Improved the detection of #include-like directives. 2009-10-08 16:00:46 +02:00
Roberto Raggi
7105b773a1 Enable completion in C++ ctor-initializers. For example,
struct foo {
  int m_zoo;

  foo(): m_ // cursor is here.
2009-10-08 15:33:17 +02:00
Roberto Raggi
d43cbfbb15 Renamed `awesome' :) 2009-10-05 18:43:23 +02:00