Commit Graph

10 Commits

Author SHA1 Message Date
Christian Kandeler
5c1dc40b6c CppEditor: Switch on clangd by default
Also change the corresponding settings key to force-enable it with
existing settings.

Fixes: QTCREATORBUG-22917
Change-Id: I3b5f54bf5d4261c6e4250245f44c4c360a911e5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-27 10:47:35 +00:00
Christian Kandeler
cfae24a6e5 ClangCodeModel: Enable clangd's new "dirty headers" flag, if possible
This feature will be availabe with LLVM 14,
see https://reviews.llvm.org/D95046.

Task-number: QTCREATORBUG-26810
Change-Id: I0a6797a836c56f5b72cca34be8f2d3edf8ac7359
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-24 12:46:29 +00:00
David Schulz
655e64b2da clangd: fix saving clangd settings
amends 6cf6f1c230

Change-Id: Ib9007805783cfac258a73b81b7e1a401f9fbc2df
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-12-07 10:06:58 +00:00
Orgad Shaneh
6cf6f1c230 CppEditor: Save Clangd settings in human-readable form
in the global settings.

Change-Id: I2f90388c138c92f03f78044e225574ded640d4b9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-12-06 11:42:18 +00:00
Christian Kandeler
0cc4617c78 CppEditor: Add settings for clangd session mode
Complete with (hidden) UI. Doesn't do anything yet, because some
assumptions about projects need to be adapted on the LanguageClient side
first.

Task-number: QTCREATORBUG-26526
Change-Id: I34c92555e34c3d3ed98462261d47b35dfc015ce0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-12-01 13:26:35 +00:00
Christian Kandeler
c97a144034 CppEditor: Move static variable to function
Following the principle of scope minimization.
Also, we got a reproducible crash-on-exit with MSVC with the original
code.

Change-Id: I465f4376fa7928de9bb878aee5faac992f75bf08
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-11 09:28:18 +00:00
Christian Kandeler
4dfdbf91f6 CppEditor: Do not use clangd < 13
We will shortly need to use a command-line option that is new in clangd
13. Rather than starting to add checks for versions that won't work as
expected anyway, we simply refuse to use clangd < 13 now.

Change-Id: I42ec679e0f58449a2593cf92b4be7ed3101fa787
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-01 14:19:27 +00:00
Christian Kandeler
2ecbbb126d ClangCodeModel: Do not let clangd insert header files on completion
... by default.
This feature often doesn't do what you'd want it to, so we make it opt-
in.

Change-Id: I631eae9c154ddcb0e8feeac44c5d5c0265706a67
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-27 10:17:39 +00:00
Christian Kandeler
575ca89b3e CppEditor: Do not save clangd file path in settings
... if it is the default value.

Change-Id: I5efde72abe5a1979144352d09d461642f936224a
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-20 09:03:53 +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