Open GrayJack opened 2 days ago
Synced to Apple’s issue tracker as rdar://130831950
The argument label is deliberately marked as function
because
label
is an LSP extension from clangd and I expect that many themes don’t support that, so that’s why I prefer not use it.parameter
in LSP seems to be intended for variables that are parameters, not for labels.https://github.com/swiftlang/sourcekit-lsp/pull/983 has some discussion around this same issue. I’m closing this issue because I think it behaves correctly based on these considerations. If you disagree, please re-open it.
@ahoppen After reading the previous discussion, I agree that the token should be function
, but I think it deserves some kind of modifier if someone would like to do some styling or coloring in that particular token.
My particular niche for this feature is that I help create themes for neurodivergent people, some of them have a better time reading and writing code when coloring+styling are unique to certain tokens.
Although that is my niche, I also saw people wanting to colorize code differently for other reasons as well, as some forms of visual synesthesia for example, but also people that just prefer to add something more for their head context
Adding a modifier seems reasonable. Let’s re-open it for that. If you’re interested in opening a PR for this change, that would also be welcome. It should be a fairly easy change.
Yes, I'm interested!
Do you think there is any modifier that would fit this use case?
At first glance, I think no existing modifier fits 100%, so I'm thinking of adding a new one, parameterLabel
, or something similar
I think adding a new modifier would be the way to go
Swift version
swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-22-a
Platform
macOS 14.0
Editor
Visual Studio Code
Does the issue reproduce with Swift 6?
Yes
Description
The parameter label of the function is being tokenized as a
function
semantic token. I expected this token to be something different thanfunction
, maybelabel
orparameter
with modifierlabel
?For me, this is happening with 5.10 and
swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-22-a
Steps to Reproduce
Developer: Inspect Editor Tokens and Scope
function
Logging
No response