This helps improve the syntax highlighting for Objective-C code,
although it currently doesn't work well in VS Code with
methods/properties/ivars since we don't currently include the proper
decl context (e.g. class).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LMK if you can think of a better approach to decide which language to use here. Likely will send a follow up diff to include more context in the Objective-C decl printing so they highlight properly.
thanks, mostly looks good. any reason for not doing it centrally though ?
clang-tools-extra/clangd/Hover.cpp | ||
---|---|---|
1024 | can we set it once around here instead? |
Likely will send a follow up diff to include more context in the Objective-C decl printing so they highlight properly.
This might make sense if it provides useful context to human readers without too much syntactic weight.
However if the issue is that particular editors are mis-highlighting snippets of ObjC, that's probably rather bugs to file against those editors (or maybe reasons to drop the language and fall back to regular highlighting)
Right, we're just missing the decl context (since objc decls must be in a top level container)
e.g. currently we have:
// In AppDelegate() @property(nonatomic, assign, unsafe_unretained, readwrite) NSInteger version;
instead we could show
@interface AppDelegate() @property(nonatomic, assign, unsafe_unretained, readwrite) NSInteger version; @end
thanks, lgtm!
clang-tools-extra/clangd/unittests/HoverTests.cpp | ||
---|---|---|
968 | nit: we can drop that since we're only checking for definition language field. |
can we set it once around here instead?