Commit 68f141de authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Send more client capabilities, rust-analyzer doesn't work otherwise

parent a3599907
......@@ -727,6 +727,16 @@ static QList<LSPCodeAction> parseCodeAction(const QJsonValue &result)
return ret;
}
static QJsonArray supportedSemanticTokenTypes()
{
return QJsonArray({QStringLiteral("namespace"), QStringLiteral("type"), QStringLiteral("class"), QStringLiteral("enum"),
QStringLiteral("interface"), QStringLiteral("struct"), QStringLiteral("typeParameter"), QStringLiteral("parameter"),
QStringLiteral("variable"), QStringLiteral("property"), QStringLiteral("enumMember"), QStringLiteral("event"),
QStringLiteral("function"), QStringLiteral("method"), QStringLiteral("macro"), QStringLiteral("keyword"),
QStringLiteral("modifier"), QStringLiteral("comment"), QStringLiteral("string"), QStringLiteral("number"),
QStringLiteral("regexp"), QStringLiteral("operator")});
}
static LSPSemanticTokens parseSemanticTokens(const QJsonValue &result)
{
LSPSemanticTokens ret;
......@@ -1128,7 +1138,11 @@ private:
{QStringLiteral("range"), false},
{QStringLiteral("full"), QJsonObject{{QStringLiteral("delta"), true}}}
}
}};
},
{QStringLiteral("tokenTypes"), supportedSemanticTokenTypes()},
{QStringLiteral("tokenModifiers"), QJsonArray()},
{QStringLiteral("formats"), QJsonArray({QStringLiteral("relative")})},
};
QJsonObject capabilities{{QStringLiteral("textDocument"),
QJsonObject{{
QStringLiteral("documentSymbol"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment