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

feature: Add semantic tokens for sbt and script files #4853

Merged
merged 1 commit into from Jan 16, 2023

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jan 12, 2023

Previously, semantic tokens would not work for files ending with .sc or .sbt. Now they properly work with correct types inferred by the compiler.

Main parts were:

  • discarding any tokens that were added to the file, this required making sure that adjust position would return lines < 0, so that we can recognize those tokens
  • make sure that the first token had the correct deltas
  • worksheets need to have semantic tokens refreshed after downloading all dependencies etc.
  • added tests for all the possibilities including Ammonite scripts, worksheets, sbt files within sbt BSP and Bloop

@tgodzik tgodzik force-pushed the script-sbt-semantic branch 2 times, most recently from 05a3bfd to 2223156 Compare January 13, 2023 11:12
Previously, semantic tokens would not work for files ending with `.sc` or `.sbt`. Now they properly work with correct types inferred by the compiler.

Main parts were:
- discarding any tokens that were added to the file, this required making sure that adjust position would return lines < 0, so that we can recognize those tokens
- make sure that the first token had the correct deltas
- worksheets need to have semantic tokens refreshed after downloading all dependencies etc.
- added tests for all the possibilities including Ammonite scripts, worksheets, sbt files within sbt BSP and Bloop
Copy link
Member

@jkciesluk jkciesluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it for some time and it works good, great job!

@tgodzik tgodzik merged commit 0056c60 into scalameta:main Jan 16, 2023
@tgodzik tgodzik deleted the script-sbt-semantic branch January 16, 2023 09:40
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.

None yet

2 participants