Commit Graph

5 Commits

Author SHA1 Message Date
Christian Kandeler
c4256a9a2b CppEditor: Squash three copies of the "is in comment or string" check
Change-Id: Id6c4e35ae2d3b3031e5c95ea04f5b971bef58389
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-15 07:54:51 +00:00
Christian Kandeler
29c0512416 ClangCodeModel: Do not use clangd for completing #ifdef & friends
Annoyingly, LLVM does not complete preprocessor directives in disabled
code, so that we would not offer e.g. "#endif" after "#if 0" (but we
would offer it after "#if 1").
Fixing it would require messing with the clang libs (rather than just
clangd), so let's just keep using our existing code, which seems to work
fine.

Change-Id: I9dabf9a2a8f3a2f68e88a11b62c3df3b5e64a55c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-29 09:31:33 +00:00
David Schulz
4324f3e8c1 Editor: pass AssistInterface to createProcessor
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>
2021-09-16 08:25:36 +00:00
Christian Kandeler
c8bc0eb512 CppEditor: Merge two smaller headers into cpptoolsreuse.h
Change-Id: If83190725a003a49bcd915225f049ccaf186f985
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-07 08:49:42 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
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>
2021-09-01 14:53:58 +00:00