Both SymbolKind and indexSymbolKindToSymbolKind support constructors and
separate them into a different category from regular methods.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/FindSymbols.cpp | ||
---|---|---|
182–183 |
Am I missing something? We still have:
case index::SymbolKind::Constructor: case index::SymbolKind::Destructor: return SymbolKind::Constructor;
in Protocol.cpp. E.g. Constructors and Destructors are still classified badly. I suppose the bit around they're all methods are wrong though, maybe just drop that bit ?
Yeah but the LSP SymbolKind which we are converting to does not have a destructor type, same thing with CompletionItemKind, so I guess we really do treat ctors and dtors the same way from the LSP perspective, aren't we?
Yeah but the LSP SymbolKind which we are converting to does not have a destructor type, same thing with CompletionItemKind, so I guess we really do treat ctors and dtors the same way from the LSP perspective, aren't we?
Yes, and that's what the previous fixme was saying. Now we are dropping that bit, but the code is still behaving badly?
I thought the point of the comment was us not handling it properly rather than LSP not supporting it (e.g. LSP does support Operator but we do not). Then, the comment about ctor and dtor being indistinguishable probably belongs to Protocol.h/cpp and SymbolKind there in particular?
I thought the point of the comment was us not handling it properly rather than LSP not supporting it (e.g. LSP does support Operator but we do not). Then, the comment about ctor and dtor being indistinguishable probably belongs to Protocol.h/cpp and SymbolKind there in particular?
If that was the case I would expect this comment to be above previous line, i.e. index::getSymbolInfo, as that's the one doing the clang-level mapping. Whereas indexSymbolKindToSymbolKind does LSP mapping.
Note, I've cargo-culted this comment into declToTypeHierarchyItem() as well, so whatever change we make here should be made there too.