Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qqmlsemantictokens_p.h>
Static Public Member Functions | |
static QList< int > | encodeSemanticTokens (Highlights &highlights) |
static QList< QQmlJS::SourceLocation > | sourceLocationsFromMultiLineToken (QStringView code, const QQmlJS::SourceLocation &tokenLocation) |
Returns multiple source locations for a given raw comment. | |
static void | addModifier (QLspSpecification::SemanticTokenModifiers modifier, int *baseModifier) |
static bool | rangeOverlapsWithSourceLocation (const QQmlJS::SourceLocation &loc, const HighlightsRange &r) |
static QList< QLspSpecification::SemanticTokensEdit > | computeDiff (const QList< int > &, const QList< int > &) |
static void | updateResultID (QByteArray &resultID) |
Definition at line 90 of file qqmlsemantictokens_p.h.
|
static |
Computes the modifier value. Modifier is read as binary value in the protocol. The location of the bits set are interpreted as the indices of the tokenModifiers list registered by the server. Then, the client modifies the highlighting of the token.
tokenModifiersList: ["declaration", definition, readonly, static ,,,]
To set "definition" and "readonly", we need to send 0b00000110
Definition at line 664 of file qqmlsemantictokens.cpp.
|
static |
Definition at line 707 of file qqmlsemantictokens.cpp.
Referenced by SemanticTokenDeltaHandler::process().
|
static |
Definition at line 628 of file qqmlsemantictokens.cpp.
References Highlights::highlights(), and token.
Referenced by Highlights::collectTokens().
|
static |
Check if the ranges overlap by ensuring that one range starts before the other ends
Definition at line 675 of file qqmlsemantictokens.cpp.
References QQmlJS::SourceLocation::length, and QQmlJS::SourceLocation::offset.
Referenced by HighlightingVisitor::operator()().
|
static |
Returns multiple source locations for a given raw comment.
Needed by semantic highlighting of comments. LSP clients usually don't support multiline tokens. In QML, we can have multiline tokens like string literals and comments. This method generates multiple source locations of sub-elements of token split by a newline delimiter.
Definition at line 580 of file qqmlsemantictokens.cpp.
References QQmlJS::SourceLocation::length, and pos.
|
static |
Definition at line 687 of file qqmlsemantictokens.cpp.
References i.
Referenced by SemanticTokenDeltaHandler::process(), SemanticTokenRangeHandler::process(), and SemanticTokenFullHandler::process().