Commit Graph

35 Commits

Author SHA1 Message Date
David Schulz
d2a07dfa0d Editor: Fix Completion of includes triggered at '.'
Task-number: QTCREATORBUG-7522

Change-Id: I1a6c165b968fcb0a4058e91f95ca70d8b77a8970
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2012-10-10 07:55:56 +02:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Eike Ziller
42f4595e37 Merge remote-tracking branch 'origin/2.5'
Conflicts:
	src/libs/cplusplus/cplusplus-lib.pri

Change-Id: I430ec8c6dda4afad3aedb1bc47d3af64537cfe66
2012-07-24 14:17:33 +02:00
Christian Kamm
9121c21230 C++: Fix class scope completion for templates.
* You now get completion for std::vector<int>::[complete].
* Also added a test.

Conflicts:
	src/plugins/cpptools/cppcompletion_test.cpp
	src/plugins/cpptools/cpptoolsplugin.h

Change-Id: I596ebf6bd18ec9a347113f8d162cc124c8a0d6b4
Reviewed-by: hjk <qthjk@ovi.com>
2012-07-20 13:41:15 +02:00
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Sergey Shambir
edabcb40fa Added tooltips on completions proposals
Change-Id: Ic22b99e25159edfa4977e13c98f334ce75809af7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-07-17 10:19:43 +02:00
Leandro Melo
7d63548964 C++: Fix potentially infinite loop in completion
Could be reproduced in code as below (cursor at |):

    QFormLayout|formLayout *fl = new QFormLayout(this);

Change-Id: I7f5e9ac8ff8dfffbca63d7ab9f837333440c9810
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-29 15:41:40 +02:00
Leandro Melo
93894ab160 C++: Do not reuse content in completion if it's unfinished identifier
Taskn-number: QTCREATORBUG-7521

Change-Id: I7b8edb93d143f599c93a82c82bf2c0d49c8e49e9
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-06-20 16:08:23 +02:00
Erik Verbruggen
60db573660 [C++] Rewrite of the preprocessor.
This rewrite fixes a couple of issues with the pre-processor. It now
supports:
- macros in macro bodies
- stringification of parameters [cpp.stringize]
- the concatenation operator [cpp.concat]
- #include MACRO_HERE
- defined() inside macro bodies used in pp-conditions.

Change-Id: Ifdb78041fb6afadf44f939a4bd66ce2832b8601f
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-29 14:28:17 +02:00
Francois Ferrand
c1f3b7170d Do not add parentheses when completing dereferenced function.
When completing function name, scan text backwards to find if we are
trying to dereference the function.

Change-Id: I32cabecb651ff35d949600d9fdeb61c8e68ae98f
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-13 11:12:45 +01:00
Erik Verbruggen
2d262bd3b7 [C++] Added object pool handling for CompletionAssistProvider.
Change-Id: I89634989a7f360a30f7ed1bde4e67c93551ddfe4
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-23 10:33:50 +01:00
Eike Ziller
d66acb51d0 Rename IFile->IDocument and FileManager->DocumentManager
And adapt the other API respectively.

Change-Id: I1e04e555409be09242db6890f9e013396f83aeed
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-20 13:32:49 +01:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
Leandro Melo
70b64280ee Improve code-assist API isSortable
Now IGenericProposalModel::isSortable also takes the current prefix
as a parameter. This is particularly useful for cases like in the C++
completion: For global completions it will only sort if there's
already a content prefix - Notice, however, that the "sorting threshold"
for a maximum number of items is still kept in IGenericProposalModel::sort.

Task-number: QTCREATORBUG-6404
Change-Id: I3c2f282aa565287b8b4989930b6a27093862ef25
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-02-10 14:25:42 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
hjk
4a21f0c3c8 Use new static ICore interface.
Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-24 18:48:47 +01:00
Leandro Melo
efe9bca20c C++: Replace non-absolute-critical asserts for soft ones
Change-Id: I021074a78d90929b4e83b8aff9db1ae7995e8c6a
Reviewed-by: hjk <qthjk@ovi.com>
2012-01-24 09:58:59 +01:00
Leandro Melo
c287d90604 C++: Rename source/setSource to utf8Source/setUtf8Source
Continuinng a previous commit... This is in order to make
the interface clearer.

Change-Id: Ic1b05217f878578bc84a064927507b75981c47d6
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-13 11:22:28 +01:00
Leandro Melo
fd179ed951 C++: Accept UTF-8 byte arrays in type of expression
The model uses UTF-8 internally and it makes more sense to only
convert when necessary.

A following commit will rename the source/setSource methods in
document for more clarity too.

Change-Id: I960ea0754efabd1436ad4b4299a57faeb65a8bee
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-13 10:17:03 +01:00
Eike Ziller
85cf2b661e Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/libs/qmljs/qmljsinterpreter.cpp
	src/libs/qmljs/qmljsinterpreter.h
	src/plugins/debugger/qml/scriptconsole.cpp
	src/plugins/git/gitplugin.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h

Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
2011-11-11 09:46:25 +01:00
hjk
82f5573626 more Id type fixes
Change-Id: I3720946ba5485696822976567d83b4d6cb1fb283

x

Change-Id: Iab58bc34bc56371405d132315573b484a533b77c
Reviewed-by: hjk <qthjk@ovi.com>
2011-11-10 15:57:09 +01:00
hjk
31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
Yuchen Deng
4ea9c21932 C++: Improve completion assist
Avoid inserting characters that are already there.
e.g.
int testFly() {}
te|Fly()
When triggers a completion, the code will changed to:
testFly()|
But in before, the code will changed to:
testFly()|Fly()

Notice:  Character of '|' show the cursor position.

Change-Id: I6c111e30356b2549aebc6fbea05608e70d6ab41f
Merge-request: 398
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-10-17 12:22:00 +02:00
Leandro Melo
a1fa169219 C++: Fix duplicate items in C++ completion for Qt methods
In the old code completion engine items were created on the stack
and passed around by value. With the refactoring of the code assist
API they became heap objects manipulated through pointers. This
patch fixes one reminiscence not caught during the refactoring
in which the same actual pointer was being used more than once to
be appended on the list.

Change-Id: I2009fb0b6aa18df57aa5ca9bde0591536ca2cd74
Reviewed-on: http://codereview.qt-project.org/4444
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-08 14:53:54 +02:00
Leandro Melo
e15443e952 Code assist: Fix memory leak in completion
One fix is in the runner, which is part of the completion
engine itself. The other is specific for C++.

Task-number: QTCREATORBUG-5947
Change-Id: Ib8fff1eb5adad1ffb2a11da66c50b545e1457df8
Reviewed-on: http://codereview.qt.nokia.com/4355
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-07 14:42:16 +02:00
Christian Kamm
815d9cb14d C++ completion: Minimize qualified names in function signatures.
Change-Id: I8e2c38e279952372b3e12f6ea8da18b75b39a5d4
Reviewed-on: http://codereview.qt.nokia.com/2733
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-08 14:48:03 +02:00
Leandro Melo
890254b0f1 C++ editor: Share the model data acrross completion items
More than one proposal item could be accessed during an iteration.
So they should not take ownershipt of the data, but simply share it.

Change-Id: I7b81b8772cd8ad4d6c2332ba6b5bc320055cd5a2
Reviewed-on: http://codereview.qt.nokia.com/136
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-05-26 12:25:58 +02:00
Leandro Melo
be48bfb2fe C++ editor: Check _ to accept idle editor completion
In addition to letters and numbers.

Change-Id: I89ec68c50a62516cc0b91d267fd96bb908cbf8bc
Reviewed-on: http://codereview.qt.nokia.com/131
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-26 12:14:34 +02:00
Leandro Melo
0350314b22 Completion: Don't propose when there's a "good" candidate
This also generalizes some code previously specific to C++.

Change-Id: I5774d04a45f28a4e276a0ef282ce0aa5a2f2e552
Reviewed-on: http://codereview.qt.nokia.com/48
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-20 17:11:49 +02:00
Leandro Melo
956bac297b C++ editor: Fix potential crash in completion
There was still a problem in the previous change (that's
why it was reverted) which should be fixed now.

Task-number: QTCREATORBUG-4940
Change-Id: I8a0d993b9f313fc98494cf93fed1f87939a358b1
Reviewed-on: http://codereview.qt.nokia.com/27
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-05-19 18:37:22 +02:00
Leandro Melo
d4e5b81e43 Revert "C++ editor: Fix potential crash in completion"
This reverts commit a395022a84.

There are some undesired side effects...

Change-Id: I001ed375911a4ffda5bd25c804ce06f99be40e3c
Reviewed-on: http://codereview.qt.nokia.com/25
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-05-19 16:54:23 +02:00
Leandro Melo
a395022a84 C++ editor: Fix potential crash in completion
Task-number: QTCREATORBUG-4940
Change-Id: If55c2ddc7949cbd31029eef8317b4d0a015f272e
Reviewed-on: http://codereview.qt.nokia.com/17
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-19 16:22:41 +02:00
Leandro Melo
0dc449944d c++ editor: Fix automatic completion for includes
Reviewed-by: Roberto Raggi
2011-05-18 16:33:39 +02:00
Leandro Melo
ab40e9c78e C++ editor: Remove scanning/caching of includes
With the completion now in a separate thread this should
no longer be necessary.

Reviewed-by: Roberto Raggi
2011-05-18 12:35:53 +02:00
Leandro Melo
bec4f02495 New code assist API
This is a re-work of our completion engine. Primary goals are:

- Allow the computation to run in a separate thread so the GUI is not locked.
- Support a model-based approach. QStrings are still needed (filtering, etc), but
internal structures are free to use more efficient representations.
- Unifiy all kinds of *assist* into a more reusable and extensible framework.
- Remove unnecessary dependencies on the text editor so we have more generic
and easily "plugable" components (still things to be resolved).
2011-05-18 10:46:20 +02:00