Commit Graph

10 Commits

Author SHA1 Message Date
Christian Kandeler
68846a7729 ClangCodeModel: Provide highlighting via clangd
Note that we lose the highlighting for virtual function calls. We need
to amend clangd to add the respective information to its semantic tokens
message.
Also, Qt properties are no longer highlighted as class members. We'll
investigate how to best restore this feature.

Change-Id: I403712aada3d7a8e1c7b7c1277f43f7f64f8450b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-05 07:39:06 +00:00
David Schulz
62cf127376 LanguageClient: highlight methods as functions
...like our internal or clang code model.

Change-Id: Ibe817611276999815fd28a22a73e07671a696479
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-10 11:46:58 +00:00
David Schulz
2d31ae0480 LanguageClient: Fix semantic token highlight
Ignore unknown modifiers when building up and accessing the text char
format hash.

Change-Id: I7e11e3fb6f4240083045368daec54e417416efa9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-10 11:46:52 +00:00
David Schulz
0ab08e8574 LanguageClient: fix semanctic token delta data manipulation
Make sure that multiple edits are in order.

The SemanticTokensEdit start is relative to the start of the data and
not to the position of the previous edit.

Do not try to be smart when calculating the start of the modification,
but assume that start is always a preedit index.

Change-Id: I3e1513f5fe631aac21fecb5e0611d987355e2c21
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-12 12:14:54 +00:00
David Schulz
0938452199 LanguageClient: remove unnecessary member function calls
Change-Id: I27e626cdef9c8f645cc1ea2f79ec6cfda09342fb
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
2021-05-06 10:48:09 +00:00
David Schulz
f1bb3b6811 LSP: add semantic tokens
Change-Id: Ia6865ec6991ec62ae9f0dc2dfa692f1f27318ed1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-21 11:33:56 +00:00
Tom Praschan
5fcd52fe83 ClangCodeModel/TextEditor: Add support for highlighting parameters
This is already built into clang, so we just need to expose it to the
highlighter and the UI.

Fixes: QTCREATORBUG-24880
Change-Id: I6d0595af2589a9b69eb954aafad46457ab2c5752
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-15 09:48:24 +00:00
Alexis Murzeau
aa68902b62 LSP: update semantic highlighting to use more colors
The actual highlighting of the C++ code using clangd doesn't use many
colors to differentiate symbols (for example, fields of a class).

This commit makes symbols more visible for these categories:
 - static methods
 - preprocessor macros
 - struct and class fields
 - static fields

Change-Id: I001325cf5e48aa07d7397b2b7ac98a65501e1d5d
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-29 19:36:39 +00:00
David Schulz
b9af9881a9 LanguageClient: update semantic highlighting only if server supports it
Task-number: QTCREATORBUG-23599
Change-Id: I76c804b51362ad6ab2aecf0631a16289a33e4810
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-18 12:03:29 +00:00
David Schulz
307f1d8e6e LanguageClient: add support for proposed semantic highlight
implements the current proposal for the semantic highlighting
via the language server protocol.
https://github.com/microsoft/vscode-languageserver-node/pull/367

Change-Id: I857d606fcf5c782e0ea8e18e5d098edd26286aed
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-06-21 08:37:11 +00:00