-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new semantic token types #4232
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4232 +/- ##
==========================================
- Coverage 89.87% 89.79% -0.09%
==========================================
Files 37 37
Lines 4780 4780
==========================================
- Hits 4296 4292 -4
- Misses 484 488 +4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 LGTMs obtained (waiting on @bstaletic)
python/ycm/semantic_highlighting.py
line 53 at r1 (raw file):
'regexp': 'String', 'operator': 'Operator', 'decorator': 'Comment',
did a quick scan of the existing vim runtime files for decorator
and see a little bit of inconsistency, but nothing like Comment; more decorators are highlighted like macros:
313:hi def link pythonDecorator Define
314:hi def link pythonDecoratorName Function
2091:hi def link typescriptDecorator Special
Taking some liberty, I checked annotation too (as decorator/annotation are similar concepts), where PreProc is common:
385:hi def link dAnnotation PreProc
208:hi def link scalaAnnotation PreProc
201:hi def link scalaParameterAnnotation Function
202:hi def link scalaParamAnnotationValue Keyword
203:hi def link scalaCommentAnnotation Function
348:hi def link javaAnnotation PreProc
So I suggest following something like that. Maybe PreProc, maybe Special?
python/ycm/semantic_highlighting.py
line 58 at r1 (raw file):
# These are not part of the spec, but are used by clangd 'bracket': 'Normal', 'concept': 'Normal',
concept is a sort-of type right ? how does this look in practice ?
I know users can override HL groups but I feel like we should make it look good in the general case?
f0a9213
to
ba7c7ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 LGTMs obtained (waiting on @puremourning)
python/ycm/semantic_highlighting.py
line 53 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
did a quick scan of the existing vim runtime files for
decorator
and see a little bit of inconsistency, but nothing like Comment; more decorators are highlighted like macros:313:hi def link pythonDecorator Define 314:hi def link pythonDecoratorName Function
2091:hi def link typescriptDecorator Special
Taking some liberty, I checked annotation too (as decorator/annotation are similar concepts), where PreProc is common:
385:hi def link dAnnotation PreProc 208:hi def link scalaAnnotation PreProc 201:hi def link scalaParameterAnnotation Function 202:hi def link scalaParamAnnotationValue Keyword 203:hi def link scalaCommentAnnotation Function 348:hi def link javaAnnotation PreProc
So I suggest following something like that. Maybe PreProc, maybe Special?
Went with Special
, but could not get pyright to work, so could not test.
python/ycm/semantic_highlighting.py
line 58 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
concept is a sort-of type right ? how does this look in practice ?
I know users can override HL groups but I feel like we should make it look good in the general case?
Tested with Type
. Here's asciinema:
https://asciinema.org/a/4CdIJRP3ktEbrVlrpd8nmP35z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @bstaletic)
python/ycm/semantic_highlighting.py
line 58 at r1 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
Tested with
Type
. Here's asciinema:
https://asciinema.org/a/4CdIJRP3ktEbrVlrpd8nmP35z
I think I like Type for this. thanks.
@Mergifyio rebase |
The `decorator` type was introduced in LSP 1.17. The `concept` type is used by clangd.
✅ Branch has been successfully rebased |
ba7c7ae
to
0af031d
Compare
Thanks for sending a PR! |
PR Prelude
Thank you for working on YCM! :)
Please complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your PR:
rationale for why I haven't.
actually perform all of these steps.
Why this change is necessary and useful
The
decorator
type was introduced in LSP 1.17.The
concept
type is used by clangd.Reported by @amosnier on gitter.
The mapped value is just the first thing that came to my mind. Feel free to suggest bette alternatives.
[Please explain in detail why the changes in this PR are needed.]
This change is