Skip to content

Add some more highlighting configurations #13084

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

Merged
merged 9 commits into from
Aug 23, 2022

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Aug 22, 2022

The following can be enabled/disabled now in terms of highlighting:

  • doc comment injection (enabled by default)
  • punctuation highlighting (disabled by default)
  • operator highlighting (enabled by default)
  • punctuation specialized highlighting (disabled by default)
  • operator specialized highlighting (disabled by default)
  • macro call bang highlighting (disabled by default)

This PR also changes our attribute semantic token type to the decorator type which landed upstream (but not yet in lsp-types).

Specialized highlighting is disabled by default, as all clients will have to ship something to map these back to the standard punctuation/operator token (we do this in VSCode via the inheritance mapping for example). This is a lot of maintenance work, and not something every client wants to do, pushing that need to use the user. As this is a rather niche use in the first place this will just be disabled by default.

Punctuation highlighting is disabled by default, punctuation is usually something that can be done by the native syntactic highlighting of the client, so there is no loss in quality. The main reason for this though is that punctuation adds a lot of extra token data that we sent over, a lot of clients struggle with applying this, so disabling this improves the UX for a lot of people. Note that we still highlight punctuations with special meaning as that special entity, (the never type ! will still be tagged as a builtin type if it occurs as such)

Separate highlighting of the macro call bang ! is disabled by default, as I think people actually didn't like that change that much, though at the same time I feel like not many people even noticed that change (I prefer it be separate, but that's not enough reason for it to be enabled by default I believe :^) )

cc #12783 #13066

@frankplow
Copy link

Upstream PR adding decorator token type to lsp-types has been merged.

@Veykril
Copy link
Member Author

Veykril commented Aug 23, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Aug 23, 2022

📌 Commit 2a26b05 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 23, 2022

⌛ Testing commit 2a26b05 with merge f045f14...

@bors
Copy link
Contributor

bors commented Aug 23, 2022

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing f045f14 to master...

@bors bors merged commit f045f14 into rust-lang:master Aug 23, 2022
@Veykril Veykril deleted the highlight-config branch August 23, 2022 12:51
bors added a commit that referenced this pull request Aug 23, 2022
…chievink

fix: Register decorator token type to avoid panic

Followup to #13084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants