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

[Bug] [Rust] Inconsistent hightligting on paths #6

Closed
lnicola opened this issue May 21, 2019 · 7 comments
Closed

[Bug] [Rust] Inconsistent hightligting on paths #6

lnicola opened this issue May 21, 2019 · 7 comments

Comments

@lnicola
Copy link

lnicola commented May 21, 2019

use std::time::Duration;
fn foo1(x: std::time::Duration) {}

image

@lnicola
Copy link
Author

lnicola commented May 21, 2019

Actually, this might be intended, I'm not sure.

@georgewfraser
Copy link
Owner

This is intended---Duration is a type, the other path elements are not.

@lnicola
Copy link
Author

lnicola commented May 21, 2019

I was referring to the Duration in use std::time::Duration;.

@georgewfraser georgewfraser reopened this May 21, 2019
@georgewfraser
Copy link
Owner

I spent some time trying to colorize use declarations last night. It turns out it's very hard to correctly recognize types in use declarations. We could rely on naming conventions + a list of builtin types.

I tried to outline a "colorization philosophy" in https://github.com/georgewfraser/vscode-tree-sitter#fixing-colorization-of-an-existing-language. I definitely think it would be better if types in use declarations were colorized as types, because it would be more consistent.

@lnicola
Copy link
Author

lnicola commented May 21, 2019

Thanks :-). In the meanwhile, I'm trying to improve the syntax highlighting of https://github.com/rust-analyzer/rust-analyzer/, which in the long run should be more precise, because it has full semantic information.

@maxbrunsfeld
Copy link

👋 Nice work on this plugin @georgewfraser. In Atom, we use the naming convention for this problem. I believe we treat capitalized items in paths as types.

@georgewfraser
Copy link
Owner

Thanks for the tip @maxbrunsfeld !

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

3 participants