[PATCH] D61842: [clangd] [WIP] [Not ready for review] Semantic highlighting
Nikolai Kosjar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 21 01:52:42 PDT 2019
nik added a comment.
Some general notes regarding the current state of this patch as I was testing it with a language client:
- It still applies for current trunk, except for a *Tests* file.
- Note that a VersionedTextDocumentIdentifier has to be used, e.g. a "version" must be included in the response. This helped to get it working for now (not a proper fix):
--- clang-tools-extra/clangd/Protocol.cpp
+++ clang-tools-extra/clangd/Protocol.cpp
@@ -79,11 +79,11 @@ llvm::json::Value toJSON(const URIForFile &U) { return U.uri(); }
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const URIForFile &U) {
return OS << U.uri();
}
llvm::json::Value toJSON(const TextDocumentIdentifier &R) {
- return llvm::json::Object{{"uri", R.uri}};
+ return llvm::json::Object{{"uri", R.uri}, {"version", nullptr}};
}
bool fromJSON(const llvm::json::Value &Params, TextDocumentIdentifier &R) {
llvm::json::ObjectMapper O(Params);
return O && O.map("uri", R.uri);
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61842/new/
https://reviews.llvm.org/D61842
More information about the cfe-commits
mailing list