Also set "deprecated" field in LSP CompletionItem.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 22331 Build 22331: arc lint + arc unit
Event Timeline
I think you also need to update SymbolsYAML and Serialization.
clangd/Protocol.cpp | ||
---|---|---|
520 | do we actually want this in JSON? | |
clangd/Protocol.h | ||
771 | this is a clangd extension. | |
clangd/index/Index.h | ||
246 | would you mind packing this together with IsIndexedForCompletion, for memory size? The latter will simplify life for serialization, but up to you. |
- Pack flags in Symbol.
clangd/Protocol.cpp | ||
---|---|---|
520 | This is actually defined in LSP: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md#completion-request-leftwards_arrow_with_hook | |
clangd/index/Index.h | ||
246 | Done. Pack them into flags. |
clangd/index/Index.h | ||
---|---|---|
171 | nit: rename to IndexedForCodeCompletion, since it is more of an attribute having is in the name doesn't seem so cool. Instead of the attributes themselves maybe the checkers below should have "is" prefix. | |
172 | nit: Add a comment similar to above one leading to Deprecated()? | |
245 | nit: rename to isDeprecated ? | |
unittests/clangd/CodeCompleteTests.cpp | ||
1365 | Maybe do this on its own render so that we can have both code paths covered. Just before rendering with Opts.EnableSnippets = true below. We can simply set this one render again and check deprecated is set to true. |
Agree with Kadir's comments.
I'd just suggest reducing boilerplate a bit by taking some shortcuts.
clangd/index/Index.h | ||
---|---|---|
167 | enum class is a pain for bitfields. | |
245 | FWIW I don't think these accessors pull their weight: in calller code if (Sym.Flags & Symbol::IsDeprecated) is clear enough | |
clangd/index/Serialization.cpp | ||
309 | 3 |
unittests/clangd/SymbolCollectorTests.cpp | ||
---|---|---|
1021 | No need for the optional parameters, void TestClangc() __attribute__((deprecated)); should work as well |
this is a clangd extension.
(right?)