Introduce an assist processor that merges our built-in quickfixes with
refactoring actions from clangd ("tweaks").
For now, we make it clear which ones are coming from clangd, and we do
not filter duplicate functionality. In the future, we might want to
disable redundant built-in actions if clangd is enabled for the
respective file.
Change-Id: I04842132798c8635dfddf8cfc98cc7a6313fac09
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
The interface can be used for checking the context of a codeassist
request to determine
the correct processor that has to be created.
Change-Id: I47ddb05c46399566e27bae21711f11a3a4132c3f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Removes a pseudo-abstraction and simplifies ClangdClient.
Change-Id: I5161d069371ff92a517866bb7500517cab6781b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.
Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... 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>
It did not contain any functionality beyond the base IAssistProvider
anymore.
Change-Id: I0198b3d629f81be8c994ffed3904b5f12ee7f9b9
Reviewed-by: David Schulz <david.schulz@qt.io>
Currently we are just using the first that is found. Which could lead
to unexpected behavior. Adjust the API to make clear just one assistant
is supported per editor type.
Change-Id: I711e66b4c5c5f347118357a8bafa0ffc6d650f7e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This is required for the CodemodelBackendIPC integration in the
ClangCodeModelPlugin. Since the heavy calculation happens in a separate
process, we only need to send appropriate requests and receive results
for a working completion. However, the CodeAssist API does not fit here
since it only provides means of caculating the results in the main
thread or a worker thread. We can't use the worker thread approach since
that would lead to threading issues regarding QLocalSocket in
CodemodelBackendIPC.
IAssistProcessor::setAsyncProposalAvailable() will hand the results
back to CodeAssist in order to display them.
Change-Id: I496192560fb406ec40fa8bcb7904f7a03d2eef50
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
{Cpp,QmlJS}QuickFixProcessor were doing the same (storing a single
pointer to a IAssistProvider). This could be done in the base
class with the leaf classes removed.
Change-Id: I0e419f37c5547d5ddfcfd1a767d356040dd7e56f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Simplifies the code base by removing one level of unused
and unneeded abstraction.
- Merge {I,Default}AssistInterface to AssistInterface
- Merge {IAssist,Basic}ProposalItem to AssistProposalItem
- Merge {IGenericProposal,BasicProposalItemList}Model to GenericProposalModel
Change-Id: I54ee7b095427383d67a00fc1d87c3808c21d812d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
The base pattern is FooEditor for BaseTextEditor derived classes
and FooEditorWidget for BaseTextEditorWidget derived classes. So:
CPPEditorWidget -> CppEditorWidget
CPPEditorWidgetPrivate -> CppEditorWidgetPrivate
...::EditorWidget -> PythonEditorWidget
GLSLTextEditorWidget -> GlslEditorWidget
GLSLEditorEditable -> GlslEditor
Change-Id: I76d34a3694c2fb35491982d86e83f7e4774c0be6
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
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>
...from CompletionAssistProvider, so other providers can be executed
asynchronously, too.
Change-Id: I6ec06f6d76bc2937bc272450b4e8dffd81ee868e
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Ran script to remove inludes on a trial-and-error basis and
manually corrected it.
Change-Id: I61a5c2fff02616f6883ddf3923e4361fca6bf92b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Ran script to remove inludes on a trial-and-error basis and
manually corrected it.
Change-Id: Ic8464ea084ca1ab401e9f4a7d0183b92b4038902
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
... and adjust INCLUDEPATH accordingly.
while i'm at messing with include statements, also re-order the include
blocks according to policy and sort them within bigger blocks.
Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This way the editor does not need to know all the details of
instantiating or maintaining classes for highlighting and/or completion,
it can just ask the model manager. The change also enables different
highlighting- or completion-engines without changes to the cppeditor.
Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Previously RefactoringFiles were usually passed around by value.
However, since a RefactoringFile may sometimes own a QTextDocument
(when it was read from a file), that's not great and caused the
file to be reread after every copy.
With this change RefactoringFile becomes noncopyable and is always
owned by a shared pointer.
This change also allowed having const RefactoringFiles which is
useful because they can be safely used from other threads. See
CppRefactoringChanges::fileNoEditor.
Change-Id: I9045921d6d0f6349f9558ff2a3d8317ea172193b
Reviewed-on: http://codereview.qt.nokia.com/3084
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
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).