Commit Graph

43 Commits

Author SHA1 Message Date
hjk
e3bc7d19cf TextEditor: Move CompletionAssistProvider to *Widget
All the others live there, too.

Change-Id: I0a418bf235343d40a53fbee089234765386ee05d
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-09-03 14:02:38 +02:00
hjk
d7c2b0b681 TextEditor: Consolidate document access functions.
There was document(), textDocument() and baseTextDocument().
Two should be enough...

Change-Id: Id9e41c8d857c5cb3269a9fce5ab594d34448c982
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-08-04 10:43:56 +02:00
Christian Kandeler
93304df038 Always pass Core::Id by value.
Currently we pass in some places by value, elsewhere by const ref and
for some weird reason also by const value in a lot of places. The latter
is particularly annoying, as it is also used in interfaces and therefore
forces all implementors to do the same, since leaving the "const" off is
causing compiler warnings with MSVC.

Change-Id: I65b87dc3cce0986b8a55ff6119cb752361027803
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-01 11:52:08 +02:00
David Schulz
6e9b724006 Editor: Blockselection rewrite.
Also adding the possibility to insert text into the blockselection.

Task-number: QTCREATORBUG-7773
Change-Id: I7a47a1d630f769a8253ee1a2f21057820ea170d5
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-06-20 13:16:54 +02:00
Eike Ziller
5dd8d7cd9c Editors: Move id() from editor to document.
Change-Id: Ib81076842ab1c16832224790194b001206404d64
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-03-05 16:27:52 +01:00
Eike Ziller
236ea9efb9 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/dumper.cpp
	share/qtcreator/debugger/dumper_p.h
	share/qtcreator/debugger/test/main.cpp
	src/plugins/debugger/gdb/classicgdbengine.cpp
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.h
	src/plugins/debugger/lldblib/guest/main.cpp
	src/plugins/debugger/lldblib/ipcengineguest.cpp
	src/plugins/debugger/lldblib/ipcengineguest.h
	src/plugins/debugger/lldblib/ipcenginehost.cpp
	src/plugins/debugger/lldblib/ipcenginehost.h
	src/plugins/debugger/lldblib/lldbenginehost.cpp
	src/plugins/debugger/lldblib/lldboptionspage.cpp
	src/plugins/qbsprojectmanager/qbsstep.cpp
	src/plugins/qbsprojectmanager/qbsstep.h
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h
	src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp
	src/plugins/qnx/blackberrycheckdevmodestep.cpp
	src/plugins/qtsupport/debugginghelper.cpp

Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
2014-01-08 11:01:06 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Orgad Shaneh
1154a8c6c2 TextEditor: Add an explicit include for QScopedPointer in CodeAssistant
+ Sort the includes

Change-Id: Ia6a5afdaa42c24c9ec0f66748aec1b6224561ab7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-12-23 13:47:08 +01:00
Eike Ziller
025446b02b Move document -> code assist connect to CodeAssistant::configure
Change-Id: I6124c12a269093fbd54cbbbb47b4d7f15ffaae2f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-12-18 11:37:27 +01:00
Nikolai Kosjar
1113097c37 TextEditor/CodeAssist: Limit automatic proposals only to completions
...since it does not make sense for TextEditor::QuickFix and
TextEditor::FollowSymbol.

Regarding the bug:
- The bug was exposed by having "Active completion" set to *not*
  "Manual" in Options > Text Editor > Completion.
- After choosing one item from the overrides list the cursor was
  positioned just right before the beginning of a function name, which
  is a valid activation sequence (see CodeAssistantPrivate::process()))
  As a consequence, a new proposal was requested.

Task-number: QTCREATORBUG-10345
Change-Id: Ib0d10192863fb33c0958a9afbf76ca8e7de772f8
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-31 10:54:29 +01:00
Nikolai Kosjar
3a64f8a344 TextEditor: CodeAssist: Allow immediate proposals
Immediate proposals are displayed for asynchronous providers and fragile
proposals.

The idea is to show already available results immediately. The proposal
calculated in the process runner can then replace the immediate
proposal.

Change-Id: I7903e6677c9dfeb4957eb416062fff1fb01ff23f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-01 14:04:06 +02:00
Nikolai Kosjar
f96246209d TextEditor: Move isAsynchronous() up to IAssistProvider
...from CompletionAssistProvider, so other providers can be executed
asynchronously, too.

Change-Id: I6ec06f6d76bc2937bc272450b4e8dffd81ee868e
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-01 10:47:57 +02:00
hjk
ca15d0aa95 Apply static pattern to TextEditorSetting
Change-Id: I4e6f573d893c0aa2bb4ca9812fc8db2961dac172
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-20 10:28:22 +02:00
Orgad Shaneh
1cfca29696 TextEditor: Do not trigger autocomplete after user aborts...
... for the same function

Task-number: QTCREATORBUG-5748
Change-Id: Iadf5be76c24f95cf057c2112a8248bea2a9e20cf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-18 11:26:36 +02:00
Orgad Shaneh
0d745d34a9 TextEditor: Fix typo
Change-Id: Ia49320b7dfc759b3255c83ad1b282e7b1dd648fe
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-12 10:14:32 +02:00
Nikolai Kosjar
0c6b64484c TextEditor: CodeAssist: Initialize all pointer members to 0
Change-Id: I82ada400aeca5e4a4f5facf64f3f7f7d5d378b06
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-09-10 11:38:12 +02:00
Erik Verbruggen
7516ef4969 TextEditor: get CompletionAssistProvider from editor.
And not from the global object pool. This way, the editors that have
different highlighters for various language dialects, or editors that
support multiple languages in a single editor, can decide themselves on
what CompletionAssistProvider to provide.

Change-Id: Ieebc4a8e7b3de6470fdb8103035aa3b8b2ba6598
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-09 10:15:55 +02:00
Orgad Shaneh
e33833c8d0 CodeAssistant: Do not pop again after pressing escape
If escape is pressed within 400ms after invoking completion,
it is popped again

Change-Id: Ibf34af22def54bc9a18d804ac9ee471f075eae96
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-08-23 13:51:10 +02:00
Erik Verbruggen
5e5c5bb02b C++: re-enable quick-fix sorting.
Also make sure that "Apply function signature change" gets to the top
of the list.

Task-number: QTCREATORBUG-9441

Change-Id: Iaf67f8ea9c99ddfc973e610f7e0f4c35b7967629
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-06-04 13:10:17 +02:00
Eike Ziller
b450b3071e TextEditors: Separate away methods that actually work on a document
Introduces ITextEditorDocument. This is part of a more general "use
documents instead of editors whereever possible". It will allow to move
to e.g. ITextEditor::openedTextDocumentContents() instead of
ITextEditor::openedTextEditorsContents().

Change-Id: I5ebceaa257a0d2c3e8ac4ac51b9b08b6faa42487
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-04-19 16:21:30 +02:00
Lorenz Haas
cb65cf3c1b Editor: Fix crash with 0-pointer in codeassistant.cpp
Task-number: QTCREATORBUG-9160

Change-Id: Iafc7a8342a91466ac33b07b73a85d9fca228b855
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-19 08:22:56 +02:00
Andrey M. Tokarev
72e0ded3c4 CppEditor: add more sections (protected, ...) for declaration (refactoring)
You can write definition of function, type Alt+Enter, as usual,
and select not only public but also other possible sections
like private, public slots and so on.

Change-Id: I2faefc3833c6f05c9e2e5a2a41328bcdbe17ba14
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-18 15:08:19 +02:00
Nikolai Kosjar
1e59df6fb0 TextEditor: Simplify testing of code assistant
Change-Id: I6f16dd775a7c5d8eaa4944d6050bf979be83a303
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-03-20 13:45:02 +01:00
Nikolai Kosjar
c3b6d1501c C++: Add some QTC_ASSERT guards in CodeAssistPrivate
This should prevent a not reproducible crash.

Change-Id: I8ebdec02799e1eccd37e918d5ab02a0a7fa5afac
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-03-06 12:01:10 +01:00
Erik Verbruggen
ff6e100824 C++: prevent cloning the QTextDocument on the UI thread.
Now the document contents (the text) is passed to the background thread,
which in turn will recreate the text document.

Change-Id: I7af47348fe162b53b8b440f1561a9919bf3c381a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-02-26 16:25:25 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01: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
Tobias Hunger
5eecccaa61 Remove unused member variable
Change-Id: If141c0c8bbc1ccffdaeaecdb7b3666f88b82f4eb
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-08-07 15:04:17 +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
Eike Ziller
e3c354d8f2 Make PluginManager mostly static.
Change-Id: Ib938aa4999c7c418a82304c5cca2e8748ef9d228
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-19 16:11:40 +02:00
Oto Magaldadze
4db1772a4f Fixed completion list not appearing when function signature is shown
Task-numer: QTCREATORBUG-6052

Change-Id: Ic91df1d9abaa509fea25ed35f86583182cd61433
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-04-13 21:15:17 +02: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
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
Christian Kamm
7bafb8adfa Completion: Fix completion not triggering sometimes.
The problem was that an automatically triggered 'idle' completion result
could come in while we were waiting for actual 'triggered' completion
and then the real completion result would be discarded.

To avoid that:
* Only accept proposals from the currently running completion.
* Increase the idle completion timeout to 400ms so it doesn't get
  triggered during regular typing.

Change-Id: Ibb2fa8907a2b67a94e092dfdc5a48fb50be06b65
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-11-23 12:16:02 +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
hjk
dbe1653775 more style
Change-Id: Iecd6819a5376beced5413f134d3026fb889a13b1
Reviewed-on: http://codereview.qt-project.org/5115
Reviewed-by: hjk <qthjk@ovi.com>
2011-09-19 08:56:31 +02:00
Leandro Melo
a457124c54 CodeAssist: Expand prefix only when it's a completion
Quickfixes, for instance, should not be expanded.

Change-Id: I832ea11c5a270ee290441aca0d2c7231d0ced013
Reviewed-on: http://codereview.qt.nokia.com/674
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-06-24 10:23:34 +02:00
Leandro Melo
e58e0c521c Completion: Respect explicit invocation (always)
Even if the completion popup is already visible is should
respect the behavior expected for explicit invocation.

Change-Id: Ib4635fead060b90f677bfd7b2751a20c030f67a1
Reviewed-on: http://codereview.qt.nokia.com/571
Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
2011-06-22 16:20:51 +02:00
Leandro Melo
566ae4cc46 Add comment for clarification
Change-Id: I18f35a6682a3fc26bbff51f4371d7e777541792d
Reviewed-on: http://codereview.qt.nokia.com/63
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2011-05-23 12:40:57 +02:00
Leandro Melo
1b374905f9 Completion: Make sure activation sequence has correct length
This is necessary for the very first characters typed on the editor
in the case the activation sequence length is greater than one.

Change-Id: I9ec611f816278795b7ac3f75913fccf5a52165bf
Reviewed-on: http://codereview.qt.nokia.com/47
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-20 17:11:44 +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