- Categories will now show up as MyClass(Category) instead of Category and MyCategory() instead of (anonymous) in document symbols
- Methods will now be shown as -selector: or +selector: instead of selector: to differentiate between instance and class methods in document symbols
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm not an objc guy, but can you add a test case demonstrating class(?) methods showing as +name:?
clang-tools-extra/clangd/AST.cpp | ||
---|---|---|
224–226 | nit: Can make these const auto * as the type is spelt in the initialisation. |
clang-tools-extra/clangd/AST.cpp | ||
---|---|---|
224 | I'm not sure this fits with the contract of printName, which really is to print the name of the symbol rather than describe it. Examples:
We don't actually populate detail in documentSymbol, so maybe we do need a separate function that gives that level of detail. See also https://github.com/clangd/clangd/issues/520 https://github.com/clangd/clangd/issues/601 though both appear to have stalled. | |
228 | in the other patch this was with -[brackets] |
clang-tools-extra/clangd/AST.cpp | ||
---|---|---|
224 | Maybe instead this should be split somehow into a separate specialization for Document Symbols? e.g. Hovercards: Document Symbols: Since I think for the case here we would prefer to keep them different. Maybe if the LSP spec differentiated between instance methods and class/static methods -method that wouldn't be necessary? I guess I could revert the Method change here and just keep a special case for categories/class extensions? The detail work seems worth doing too, but I think we would similarly just put the type information in there (for methods), for categories/class extensions I feel like it would be odd since it would at the very least repeat the name |
clang-tools-extra/clangd/AST.cpp | ||
---|---|---|
228 | We don't want to put the full form (e.g. including the container name) here - that would repeat the class name in the document symbols when the methods are already nested under the class. |
Great, thanks!
clang-tools-extra/clangd/FindSymbols.cpp | ||
---|---|---|
176 ↗ | (On Diff #326719) | can we motivate this with a comment? |
I'm not sure this fits with the contract of printName, which really is to print the name of the symbol rather than describe it.
Examples:
We don't actually populate detail in documentSymbol, so maybe we do need a separate function that gives that level of detail.
Though I wonder whether it should mosty just print the decl (e.g. class X{};, @implementation PotentiallyLongClassName(CatName) etc. WDYT?
See also https://github.com/clangd/clangd/issues/520 https://github.com/clangd/clangd/issues/601 though both appear to have stalled.