Skip to content
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

Highlight type aliases and attributes by default #3822

Closed
SomeoneToIgnore opened this issue Apr 2, 2020 · 8 comments
Closed

Highlight type aliases and attributes by default #3822

SomeoneToIgnore opened this issue Apr 2, 2020 · 8 comments

Comments

@SomeoneToIgnore
Copy link
Contributor

With zero additional highlighting-related settings and a standard VSCode dark theme, the code looks like this:

image

RA does not highlight unresolved entities, such as TreeRoot from the screenshot.

It also does not highlight type aliases (SyntaxNodeRef, RefRoot, OwnedRoot, GreenBuilder) and annotations (#derive) which makes it confusing and does not fit into the general scheme.

@matklad
Copy link
Member

matklad commented Apr 2, 2020

I think this actually regressed with the recent insiders build. We do set semantic tokens for attrs:

image

Specifically, I think they might have changed the name of the filed in package.json we use map sem tokens to tm scopes.

@kjeremy
Copy link
Contributor

kjeremy commented Apr 2, 2020

The range provider was pushed to vscode a few days ago and it looks like there' some fallout from that and a few other things.

@matklad
Copy link
Member

matklad commented Apr 2, 2020

@matklad matklad closed this as completed Apr 2, 2020
@SomeoneToIgnore
Copy link
Contributor Author

I've installed rust-analyzer version: unreleased (09b8ee3) but see no changes.
image
image

But thanks for the PR and the docs nontheless, if you won't be able to fix it, I'll check it out some time later.

@Veetaha
Copy link
Contributor

Veetaha commented Apr 2, 2020

The theme you are using doesn't define any coloring for meta.attribute Textmate scope. This is quite tricky because there are loads of scopes in the wild and themes cannot support them all.

To solve this we should actually define what the default theme is and use only the scopes that it supports.

@Veetaha
Copy link
Contributor

Veetaha commented Apr 2, 2020

I suppose Dark+ (default dark) is what vscode uses by default. Here is its textmate grammar declration file, which extends Dark (Visual Studio) and which in turn extends Dark Default Colors

@matklad
Copy link
Member

matklad commented Apr 3, 2020

I must say I generally observe weirdness around syntax highlighting... microsoft/vscode#94367 is one specific issue I've tracked down, but there are more, like variables becoming bold in typescript with pale fire for some reason...

@SomeoneToIgnore
Copy link
Contributor Author

Closing this since type aliases are now highlighted in the default theme and for the attributes there's a separate issue.

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

No branches or pull requests

4 participants