![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Functions | |
QList< int > | encodeSemanticTokens (Highlights &highlights) |
QList< QQmlJS::SourceLocation > | sourceLocationsFromMultiLineToken (QStringView code, const QQmlJS::SourceLocation &tokenLocation) |
Returns multiple source locations for a given raw comment. | |
void | addModifier (QLspSpecification::SemanticTokenModifiers modifier, int *baseModifier) |
bool | rangeOverlapsWithSourceLocation (const QQmlJS::SourceLocation &loc, const HighlightsRange &r) |
QList< QLspSpecification::SemanticTokensEdit > | computeDiff (const QList< int > &, const QList< int > &) |
void | updateResultID (QByteArray &resultID) |
QList< int > | collectTokens (const QQmlJS::Dom::DomItem &item, const std::optional< HighlightsRange > &range, HighlightingMode mode=HighlightingMode::Default) |
Highlights | visitTokens (const QQmlJS::Dom::DomItem &item, const std::optional< HighlightsRange > &range, HighlightingMode mode=HighlightingMode::Default) |
|
strong |
Enumerator | |
---|---|
Default | |
QtCHighlighting |
Definition at line 79 of file qqmlsemantictokens_p.h.
|
strong |
Definition at line 35 of file qqmlsemantictokens_p.h.
|
strong |
Enumerator | |
---|---|
None | |
QmlPropertyDefinition | |
QmlDefaultProperty | |
QmlFinalProperty | |
QmlRequiredProperty | |
QmlReadonlyProperty |
Definition at line 68 of file qqmlsemantictokens_p.h.
|
strong |
Definition at line 86 of file qqmlsemantictokens_p.h.
void HighlightingUtils::addModifier | ( | QLspSpecification::SemanticTokenModifiers | modifier, |
int * | baseModifier ) |
QList< int > HighlightingUtils::collectTokens | ( | const QQmlJS::Dom::DomItem & | item, |
const std::optional< HighlightsRange > & | range, | ||
HighlightingMode | mode = HighlightingMode::Default ) |
Definition at line 1057 of file qqmlsemantictokens.cpp.
QList< SemanticTokensEdit > HighlightingUtils::computeDiff | ( | const QList< int > & | oldData, |
const QList< int > & | newData ) |
Definition at line 993 of file qqmlsemantictokens.cpp.
QList< int > HighlightingUtils::encodeSemanticTokens | ( | Highlights & | highlights | ) |
Definition at line 914 of file qqmlsemantictokens.cpp.
bool HighlightingUtils::rangeOverlapsWithSourceLocation | ( | const QQmlJS::SourceLocation & | loc, |
const HighlightsRange & | r ) |
Check if the ranges overlap by ensuring that one range starts before the other ends
Definition at line 961 of file qqmlsemantictokens.cpp.
References HighlightsRange::endOffset, and HighlightsRange::startOffset.
QList< QQmlJS::SourceLocation > HighlightingUtils::sourceLocationsFromMultiLineToken | ( | QStringView | stringLiteral, |
const QQmlJS::SourceLocation & | locationInDocument ) |
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 866 of file qqmlsemantictokens.cpp.
void HighlightingUtils::updateResultID | ( | QByteArray & | resultID | ) |
Definition at line 973 of file qqmlsemantictokens.cpp.
Referenced by SemanticTokenDeltaHandler::process(), SemanticTokenFullHandler::process(), and SemanticTokenRangeHandler::process().
Highlights HighlightingUtils::visitTokens | ( | const QQmlJS::Dom::DomItem & | item, |
const std::optional< HighlightsRange > & | range, | ||
HighlightingMode | mode = HighlightingMode::Default ) |
Definition at line 1048 of file qqmlsemantictokens.cpp.
References HighlightingVisitor::highlights().