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

Java editor syntax highlighting via extension point #1594

Open
BoykoAlex opened this issue Aug 20, 2024 · 5 comments
Open

Java editor syntax highlighting via extension point #1594

BoykoAlex opened this issue Aug 20, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@BoykoAlex
Copy link

BoykoAlex commented Aug 20, 2024

Language servers (LSP4E project) could provide semantic tokens with highlight information for Java files. These semantic tokens are primarily for languages embedded into Java. For example Spring Java code can have embedded:

These embedded languages syntax fits nicely into LSP semantic tokens feature.

Bringing in semantic highlighting for these embedded languages into JDT Java editor is a challenge because syntax highlighting in Java editor does not allow for contributions.

(cc: @martinlippert)

@martinlippert
Copy link

We implemented the necessary logic for the highlighting via semantic tokens and LSP already inside of the language server that we are building for Spring and have this feature working nicely in VSCode (e.g. https://x.com/springtools4/status/1816014400379032005), now trying to bring this to Eclipse as well. It already works out-of-the-box when using the generic editor for Java source files, but since everybody is using the real JDT UI Java source editor in Eclipse, we would love to bring this to JDT UI as well - if possible.

@BoykoAlex submitted an initial PR for this (#1595), which is more a PoC than a ready-to-merge contribution, but would be awesome to hear from you whether the team would be interested in pushing this forward. Since it involves adding new public API to JDT UI, we would love to hear your thoughts about this.

@iloveeclipse
Copy link
Member

Haven't looked in the code yet, but the idea sounds great.

@noopur2507
Copy link
Member

As I understand, this is an enhancement that will add highlighting for embedded languages in the Java editor via an extension point. Sounds good!

@martinlippert
Copy link

Sounds like the is some consensus that this would be a good thing to implement. What are the next steps? I think we (specifically @BoykoAlex ) would need some advice on the next steps, since the PR is more meant as a draft to discuss than the final implementation (as mentioned on the PR). So would someone be willing to jump on the PR and provide overall feedback on the questions at hand? I am sure @BoykoAlex would also be around for a screenshare call to get some advice, provide some overview of the PR, etc.

@martinlippert
Copy link

(and thanks to @noopur2507 , @jukzi , @iloveeclipse for your initial reactions here, much appreciated)

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

No branches or pull requests

5 participants