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

Semantic colorization for quoted type annotations is inconsistent #5810

Open
rchiodo opened this issue Apr 26, 2024 · 8 comments
Open

Semantic colorization for quoted type annotations is inconsistent #5810

rchiodo opened this issue Apr 26, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Apr 26, 2024

image

It seems to me that the "Box[T]" should be all one color. The root cause is no semantic value for the [ in the type string.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Apr 26, 2024
@debonte
Copy link
Contributor

debonte commented Apr 26, 2024

That matches the behavior of unquoted generic types.

image

@rchiodo
Copy link
Contributor Author

rchiodo commented Apr 29, 2024

That seems incorrect to me too :)

@StellaHuang95 StellaHuang95 added bug Something isn't working and removed needs repro Issue has not been reproduced yet labels Apr 29, 2024
@debonte
Copy link
Contributor

debonte commented Apr 29, 2024

I disagree. The type var should be a different color to make it clear that it is a distinct identifier that supports, for example, go to def. I'm indifferent about the bracket coloring.

@rchiodo
Copy link
Contributor Author

rchiodo commented Apr 29, 2024

Sorry not the TypeVar, the brackets. Especially in the string. It looks super weird.

@debonte
Copy link
Contributor

debonte commented Apr 29, 2024

I see. The brackets are colored as string characters. I agree, that's weird. I'm not convinced that the brackets should be the same color as the type name though.

@rchiodo rchiodo assigned rchiodo and unassigned StellaHuang95 Apr 29, 2024
@rchiodo
Copy link
Contributor Author

rchiodo commented Apr 29, 2024

Putting in triage so we can discuss.

@rchiodo
Copy link
Contributor Author

rchiodo commented Apr 29, 2024

Decision was to provide semantic tokens for the brackets. That should make the colors consistent amongst the different ways to show a generic type.

@heejaechang
Copy link
Contributor

currently, according to "Developer: Inspect Editor Tokens and Scopes", all those [] are currently marked as various *.punctuation.* or *.quoted.* tokens/scopes from textmate

so, we can either fix it from semantic tokenizer override textmate token/scopes or we could fix textmate ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants