Commit Graph

79 Commits

Author SHA1 Message Date
Bernhard Beschow
66944dc4e9 CppEditorDocument: Return covariant return type
As a virtual method overload, completionAssistProvider() can return a
covariant return type. This preserves type information and eliminates
a qobject_cast<> in CppEditorWidget.

Change-Id: I3b29b0fa4e876bbcc43f628e6e0bbf4d73d3f689
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-20 11:41:36 +00:00
Bernhard Beschow
886c76e10f CppEditorWidget: Remove private refactoringEngine() method
d->m_modelManager can be used directly instead.

Change-Id: I11158ede3bb827ebed88706d0bfaab4e0f142f0a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-20 11:41:05 +00:00
Bernhard Beschow
e15beff0cb CppEditorWidget: Reuse d->m_modelManager attribute
d->m_modelManager is an alias to CppTools::CppModelManager::instance()
and should be used for consistency's sake.

Change-Id: I8fab163990ffb039db7900000d107c67f29a7e46
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-20 11:40:28 +00:00
David Schulz
95cba448a1 move find usages to TextEditor
In preperation for supporting find usages by the language client plugin

Task-number: QTCREATORBUG-21577
Change-Id: I7a6da3a9d53478c1d486e0ddc5829c9ea09a2a20
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-28 12:29:44 +00:00
Eike Ziller
62050437c3 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp

Change-Id: Ia723411f4b5c9c90f9786223ac6a7346d7ab9b99
2018-04-26 10:16:32 +02:00
Eike Ziller
a8aa4bbb31 More improvements of text editor tool bar
Make line/column label always visible, and move context drop down to the
right, so it vanishes first. Reduce the minimum size and stretch of the
outline drop down, so the context drop down doesn't vanish too early
either.

Task-number: QTCREATORBUG-15218
Task-number: QTCREATORBUG-19386
Change-Id: Ie2ced1cb62a27a0129438f5605d5711bfac50cd0
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-04-25 07:10:52 +00:00
Ivan Donchevskii
b5ee2773a0 CppEditor: Use QPointer to 'this' for refactoringEngine calls
RefactoringEngine does not depend on CppEditorWidget
therefore we should check that the pointer is still valid
in the lambda calls.
Hopefully fixes QTCREATORBUG-20111 though this fix does not
directly address the stack trace.

Task-number: QTCREATORBUG-20111
Change-Id: I37f996de60cebe61e290fe181d75fb266f93c1c1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-24 14:31:45 +00:00
hjk
cf4dbb4bb6 ClangSupport: Use simpler structures in some cases
The patch is mostly mechanical, but contains also a few spurious changes
from values references for some local variables, foreach -> ranged for
etc that I coulnd't resist.

Change-Id: I58f0bd972546895eb318607cbfbd7ac35caf3f23
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-06 12:55:23 +00:00
Ivan Donchevskii
08d1274ccc CppTools: Remove processEvents call from follow symbol
processEvents is a bad way of dealing with asynchronous
requests. Use QFutureWatcher for that purpose.

Change-Id: I3839cb9db80a6d391f6af1178e96986a325b7b99
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-19 13:37:46 +00:00
David Schulz
a4b5fc00a8 CodeAssist: use shared pointer to pass around proposal models
Task-number: QTCREATORBUG-17752
Change-Id: Ia41f169b86ead209830e6f15764062389ced2b67
Reviewed-by: hjk <hjk@qt.io>
2018-02-27 12:32:36 +00:00
Ivan Donchevskii
c020f2448b CPlusPlus: Add toLink method to the Symbol
Basically move it from CppTools to CPlusPlus
to be able to use it there.

Change-Id: I0af80f93bdc029824397ceafdf940cb86c4382b0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-07 14:01:52 +00:00
hjk
6c537b35d5 TextEditor: Dissolve QuickFixAssistProcessor
... into QuickFixAssistProcessor and QmlJSQuickFixAssistProcessor,
by essentially duplicating the class, but moving the actual work to
a new a GenericProposal::createProposal(...QuickFixOperations...)

Less indirection, and less code in total.

Change-Id: I2f8cba970bf587c9cbf04321269a60ed51bfae2a
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 11:59:33 +00:00
Ivan Donchevskii
8efb598e60 TextEditor: move Link class to separate header in Utils
Link is a common class and is used across the plugins.

Change-Id: Id92e47e1b8604316ca8b970804e57abaf404ec28
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-11-27 13:57:02 +00:00
Ivan Donchevskii
1c0bdb693e ClangRefactoring: enable "search again" for find/rename usages
Make its behavior closer to the builtin find/rename

Change-Id: I3730e87ca3e41677b004b98bb2e62dada5d32f22
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-22 11:56:12 +00:00
Ivan Donchevskii
32bae7ef6c Clang: use local renaming based on ClangCodeModel
Provide refactoring engine for ClangCodeModel and
implement missing methods.

Change-Id: If5c913e0c5a7941cd2ced54d0fcfa4d625eadc93
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-20 10:24:47 +00:00
Ivan Donchevskii
81f5c1c8ec Clang: implement globalRename based on clang Index
Has the same limitations as findUsages.

Change-Id: I8de4df2ecbfd8a4f3073666994398dc43af0d73c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-10-25 13:35:48 +00:00
Ivan Donchevskii
050b4dd2f5 Clang: implement findUsages with existing index
Functionality is limited to the abilities of
current index which is not updated and is
generated only at project open.
Search box temporarily doesn't allow to "Search again".

Change-Id: Id1047f27ad0aafc901f06aa51ad38ceab95eaebb
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-24 10:46:52 +00:00
Ivan Donchevskii
5c554c0de9 CppTools: add multiple refactoring engines support
Make model manager able to select the most functional
refactoring engine from the available ones.

Change-Id: I74031c910706fd694a0a7def022531501f1ea005
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-17 13:32:51 +00:00
Nikolai Kosjar
40ba7ac16f CppEditor: Avoid blocking context menu invocation
Show the menu always immediately.

If the needed use selections are not up to date for the refactoring
actions, then trigger an async run and if that one finishes, then update
the refactoring menu. In the meanwhile, show a place holder menu item
showing on-going progress (Utils::ProgressIndicator).

Change-Id: Iae7ab37738d79c20aeb1ccda2b1781091e90fdc3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-25 07:20:58 +00:00
Ivan Donchevskii
80a472740d TextEditor: move convenience from texteditor to utils
Allows to use this header without texteditor dependency.

Change-Id: I706f42799c3ea42473a716fa9ef9f3cfbef6fdd4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:59:35 +00:00
Ivan Donchevskii
a959fe59da C++: remove builtin RefactoringEngine dependency from CppEditor
Move CppRefactoringEngine to CppTools and builtin member
ownership to model manager.

Change-Id: I3e72308559fd2928229f9f25d4dd09beb3f56c34
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:59:20 +00:00
Ivan Donchevskii
55a5ffc1ec C++: remove builtin FollowSymbol dependency from CppEditor
Move FollowSymbolUnderCursor to CppTools and
builtin member ownership to internal model manager.

Change-Id: I97a4f744ec1709ccc0b34fb67b58680973ef566f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:59:05 +00:00
Ivan Donchevskii
f130de2400 Clang: use HighlightingMarks for hover with Ctrl highlighting
Make this highlighting work without builtin code model
but based on the HighlightingMarks that we already have
from ClangCodeModel.
Redundant parameters are removed by this change.

Change-Id: I73b5dab46ba59d2f813236831818f0a9bc94c5bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:58:46 +00:00
Ivan Donchevskii
32b1244b2a CppEditor: add startGlobalRenaming
Existing built-in functionality is moved there.
Clang part is to be implemented later

Change-Id: I7595898495213c087243cd534b4ba1617b4c27e9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-21 09:20:09 +00:00
Nikolai Kosjar
d6da4e5136 CppEditor: Use class enum for CppUseSelectionsUpdater::CallType
Change-Id: Iaf6df1ccec50b84048933506a46b93bedf77da8e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-19 06:59:10 +00:00
Nikolai Kosjar
af3416a9de CppEditor: Refactor CppEditorWidget::contextMenuEvent
No behavior change.

* Extract some functions
* Add some clarifying comments here and there
* Add QTC_CHECK()
* Remove QLatin1String
* foreach -> for
* Const-correctness

Change-Id: Ie6ccc987ef959c5295a4d3225aac0dbad144f91d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-19 06:59:04 +00:00
Ivan Donchevskii
a137b08eaa CppEditor: refactor FollowSymbol
Create an interface to get the ability to use
another FollowSymbol implementation

Change-Id: I5802f62523ff3ee47b8a14e487adf43edcb6c9b1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-15 14:14:01 +00:00
Ivan Donchevskii
76d12dc2d5 CppEditor: add default RefactoringEngine
..and use it when we don't have refactoring plug-in

Change-Id: Ibe317a9728d439b9c5e05271d92a330d22eaacb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-15 14:13:48 +00:00
Ivan Donchevskii
96ef6c797b CppEditor: split CppEditor and CppEditorWidget
Change-Id: Id3c815184f7f3bace0276e947f6b6f76e61ec6de
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-12 15:05:38 +00:00