Commit Graph

15 Commits

Author SHA1 Message Date
Christian Kandeler
9735049e2c ClangCodeModel: Suppress "Unknown argument" error
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>
2022-03-02 12:59:54 +00:00
Christian Kandeler
22fb18c0a8 LanguageClient: Speed up DiagnosticManager::showDiagnostics()
- Do project file look-up only if we have diagnostics.
- Move hash access out of the loop.

Change-Id: I9dd03dbfe8d7515e731cbeb0ce51639d9df993b4
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-28 09:40:08 +00:00
David Schulz
f334bd422e ClangCodeModel: prevent text mark annotations in non project files
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>
2022-02-25 13:01:40 +00:00
David Schulz
3cf6d15096 LanguageClient: track all created diagnostic marks
Removing a block results in taking marks of that line out of the
document, but does not delete those marks. So we cannot rely on
iterating over marks of a document to delete all marks for a specific
file. Instead save all marks from text mark creator for a file path and
iterate this list to delete diagnostic marks.

Fixes: QTCREATORBUG-26585
Change-Id: Idc41fce5de4ade68f4a29c23ba02844701b44d3c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-02-24 05:25:25 +00:00
David Schulz
df46c478dc LanguageClient: simplify diagnostic mark creation
Change-Id: I7d6cb17e6e1f41ab007884bb1c32f92086d3067a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-12-14 13:26:32 +00:00
David Schulz
922f9b159d LanguageClient: fix diagnostic document revision check
We track the document revision in the client nowadays.

Change-Id: Ia55bc7cd5eaf100fb19953ca71e8de8f43ae3266
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-29 04:49:50 +00:00
Christian Kandeler
7bf52b0c0d ClangCodeModel: Provide diagnostics via clangd
Change-Id: Ib45a62ebe200c2b56a1bb1a66f8a92103e60d092
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 13:22:36 +00:00
David Schulz
439bb9c4ae LanguageClient: manually track document version
Using the document revision causes issues for some servers.

Task-number: QTCREATORBUG-25766
Change-Id: Ic858e19c6fe39e57c9d3124913887aafee0a3cd0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-15 13:01:05 +00:00
David Schulz
5ae8700e92 LanguageClient: Add copy button to annotation tooltip
Change-Id: Ibe01543efa39e47de2b9d2d8e7302932bfcd413c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-19 08:57:48 +00:00
David Schulz
30e1387130 LanguageClient: clear extra selection when diagnostig gets hidden
Change-Id: I3b10301193e988eacc23eb9e55576eef5f69fb3f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 11:43:06 +00:00
David Schulz
e6d0ed3160 LanguageClient: support versioned diagnostics
Change-Id: Id182431f371201c7266fe0683e78fe56a8a9735b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 12:40:07 +00:00
David Schulz
4f1c5bacb9 LanguageClient: fix multiple crashes in languageClient
The temporary containers are needed in some places because the content of the containers change
while iterating over them.
partially reverts: cf010911f7

Change-Id: I4d6df987b9e5382b6b18fa659b1174ca6919a02e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-25 07:42:26 +00:00
Jarek Kobus
cf010911f7 Don't allocate unneeded temporary containers
Fix clazy warnings: allocating an unneeded temporary container
[clazy-container-anti-pattern]

Change-Id: I4b4c2c634eea650bbdf3c12d982a17f899fc94ec
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-12-14 12:35:47 +00:00
Alessandro Portale
a3857a996a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Amends: b2a766a79a

Round #2: This time done with Qt Creator's Analyzer, which
found other occurences than run-clang-tidy.py

Change-Id: I479e280c7abcf2d24baccbb0af69ae4bda05198e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-27 13:26:07 +00:00
David Schulz
116fb0895d LSP: move diagnostic handling from client in a separate class
Change-Id: Id70a7b82137d3a4591de521380199e546e8685f4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-15 10:45:49 +00:00