We need to relax the range check: In expressions such as x.y->z, the
second argument for the operator->call is x.y, not just y.
Fixes: QTCREATORBUG-27352
Change-Id: Ida542c11c129630f0a1d301508ec5f8076eb9902
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
... in completions. Apparently, clangd uses the LSP type "property" for
static members.
Task-number: QTCREATORBUG-27289
Change-Id: Ib296dbade6b2e7c38a761b27b2c024ea98a89523
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
By setting QT_LOGGING_RULES=qtc.clangcodemodel.clangd.timing=true I can get
values like:
qtc.clangcodemodel.clangd.timing: highlighting: Start to end: 2953 ms
qtc.clangcodemodel.clangd.timing: ClangdCompletionAssistProcessor took: 7343 ms
The first tells you how long Creator took to turn clangd's semantic tokens into
full highlighting info, and the second how long it took for Ctrl+Space.
Change-Id: I99bd04c2889bb7da98c04537eab06d6ed6117167
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Unknown compiler flags are an unsuppressable error in clang.
But we do not want to maintain a blacklist of unsupported GCC and MSVC
options or a whitelist of supported clang options, as both would
constantly go out of date.
As clangd seems to work fine despite the error message, we simply filter
out this type of diagnostic.
Fixes: QTCREATORBUG-27113
Change-Id: Ib32601831eded60daf80eb0ca5cf01bbd71493fa
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
... as output arguments with clangd.
We might want to do so in the future, but right now it's not intended.
Task-number: QTCREATORBUG-27111
Change-Id: Ie6941f18943a1d6942901c526c62999cba6c1125
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Since non project files get opened in project specific clients now, the
check whether we should add annotations needs to make sure that the
marks file is part of the client project.
Change-Id: I2790d0f7feb39162686efd06bb3542684d289b95
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
When updating translations with
cmake --build . --target ts_de
(or other language ID)
- Qualifying with unknown namespace/class ::PluginSpecPrivate
- <class> lacks Q_OBJECT macro
Change-Id: Ic42d8dffea935e6b10e59223bdedb9a8a4dcf446
Reviewed-by: hjk <hjk@qt.io>
... with clangd.
As with operator++ etc, it's immediately obvious to a developer which
arguments are modified.
Change-Id: Ia2b15d5eef7848b7ed284f8d544f039fe2927292
Reviewed-by: David Schulz <david.schulz@qt.io>
This will help avoid confusion in case of multi-project sessions.
We also shorten the message a bit so it won't be cut off in the progress
bar before the project name.
Change-Id: I0e5885f89a976b14f758f9be77e7669f199cd887
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Depending on the kind of highlighting issue we want to debug, we may or
may not be interested in the actual tokens.
Change-Id: I412126d3e97949a31f1dd5f339dc09072f28be64
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
... when highlighting with clangd.
This value is only meant for enum values, not types.
Task-number: QTCREATORBUG-27059
Change-Id: I7bb68f5deb6bb215ee3c23d995207019850a7bfc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
- Made code more self-documenting.
- Added more comments.
- Added debug output.
- Rewrote ugly redundant code checking for #ifdef & friends.
- For consistency, emit update about ifdef'ed code only
if we also report the other highlighting results.
Change-Id: Idd3cbd3c169343bcaf6b6b19330130378ac6c5d0
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>
We failed to overwrite existing characters that match the completion if
clangd also changes "." to "->" at the same time.
Note that it still doesn't work as expected if the cursor is after the
dot and before the extra character. I'm not sure yet how to fix that.
Fixes: QTCREATORBUG-27034
Change-Id: I852145fc41f34ab60d9e944783e822bc9505453b
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>
When fast switching between clients listed inside the inspector
the message response for memory usage may arrive after the model
has been destroyed.
Change-Id: I0503bb334cf21b0919316f0ac2e731472f3433bd
Reviewed-by: David Schulz <david.schulz@qt.io>
... with clangd. More specifically, for the case where we switch between
declaration and definition of a destructor. Since clangd expects the
cursor before the "~" character, we move it there.
Fixes: QTCREATORBUG-26809
Change-Id: I8ea6a060bea3545c963cb8ebbe2d3ae3a18da2d5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... when detecting output arguments with clangd.
This should lead to fewer false positives. We plan to handle false
negatives on a case-by-case basis (rather than the other way around).
Change-Id: I541b418927dc410c2ea4ea9f6c1b5a7bd291a1a8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
... with clangd.
The code is starting to look rather hacky and might need to be rewritten
completely at some point. Let's see how far we get with it.
Change-Id: I506dd410831970b9f9291b005129b4d70f397de0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Amends 825c9ea64f to work also for member access via pointer.
Change-Id: I8ee68d0f6d93c65c2f82a63bce5baef2aa2159de
Reviewed-by: David Schulz <david.schulz@qt.io>
The location of the blocks to marked ifdefed out are not tied to a
specific editor instance, but just depend on the document content.
Change-Id: I837730dc00e1d6060dd46bbb2cfccbfa5f72e6ce
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
If the cursor is right before the "." in a member access expression,
clangd interprets it as belonging to the member instead of the base
expression, which leads to unexpected behavior.
Work around this by sending a cursor position one to the left of the
real one to clangd in such cases.
Change-Id: I429ee9189760ccb02d231acfcb94ab6cfde3cd8d
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>
... when doing function call completion with clangd.
We did not take default arguments into account. E.g. the following
declaration:
void func(int i, int j = int());
was mis-detected as taking no arguments, causing to the cursor to be at
the wrong location afterwards.
Change-Id: I522921721b0cb347ed593c43ed285ca6d02ccfee
Reviewed-by: David Schulz <david.schulz@qt.io>