Skip to content

Import Highlighting #110

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

Closed
nickhudkins opened this issue Jul 1, 2020 · 4 comments · Fixed by #112
Closed

Import Highlighting #110

nickhudkins opened this issue Jul 1, 2020 · 4 comments · Fixed by #112
Labels
enhancement New feature or request

Comments

@nickhudkins
Copy link

I am slowly trying to move to VS Code for my Scala development, but one thing that still stands out to me is the lack of highlighting within imports. This is only relevant because I am coming from Intelli-J where the highlighting of imports is far more verbose.
Screen Shot 2020-06-30 at 10 15 29 PM

I have never worked on a syntax highlighting project, but am happy to dig in if this is a desired change!

Thanks for all of the work, this is an incredible improvement to my computer's battery life and fan noise 🤣

@PanAeon
Copy link
Contributor

PanAeon commented Jul 1, 2020

Hi @nickhudkins,

The class highlighting could be easily done by matching first uppercase character. But for others stuff I think Intellij uses semantic highlighting. I.e. it runs the code against actual scala parser and its own version of presentation compiler to get methods, objects and interfaces.

This project uses regex rules to get token information so atm it's impossible to distinguish for example between class Foo and interface Bar if there's no additional context, that is keyword trait before the interface name.

If you need that kind of highlighting you can check vscode tree sitter plugin. But it's in the preview stage and might not work as expected.

Also there's a semantic highlighting for vscode spec, which might be implemented by metals for example, but it is not finalized if I'm not mistaken.

nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Jul 1, 2020
@nicolasstucki nicolasstucki added the enhancement New feature or request label Jul 1, 2020
@nicolasstucki
Copy link
Contributor

This is the best we can do with syntactic highlighting

Screenshot 2020-07-01 at 15 01 58

@nicolasstucki nicolasstucki linked a pull request Jul 1, 2020 that will close this issue
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Jul 1, 2020
@nickhudkins
Copy link
Author

@PanAeon and @nicolasstucki, thanks so much for the explanation :) You've resolved my concerns, and it looks like @nicolasstucki already has a PR open to make an improvement here!

@nicolasstucki
Copy link
Contributor

Yes, I just edited that pattern a couple of days ago an knew exactly what to do.

MaximeKjaer added a commit that referenced this issue Jul 2, 2020
Fix #110: Highlight class/object names in imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants