Coder Social home page Coder Social logo

Comments (12)

BoykoAlex avatar BoykoAlex commented on July 18, 2024

@Skyxim what is wrong with the pre-release version java syntax highlighting? Can you show the diffs with spring boot tools disabled vs enabled? Are you on Windows?

from sts4.

Skyxim avatar Skyxim commented on July 18, 2024

@Skyxim what is wrong with the pre-release version java syntax highlighting? Can you show the diffs with spring boot tools disabled vs enabled? Are you on Windows?

The pre-release looks mostly fine, but the semantic tokens for class definitions are still missing. There might be other issues I haven’t noticed yet. My setup is VSCode on macOS, with the LSP running on a Debian 12 virtual machine. I’ve also tried using Windows with SSH remote, and the same issue persists.

from sts4.

BoykoAlex avatar BoykoAlex commented on July 18, 2024

Hmm.. I'm on mac as well so ideally i should be able to see the same as you. The class definition token is TestDemoApplication and the colour for it seems to be green for me for in both cases (extension enabled and disabled). Is it different for you?

from sts4.

Skyxim avatar Skyxim commented on July 18, 2024

Hmm.. I'm on mac as well so ideally i should be able to see the same as you. The class definition token is TestDemoApplication and the colour for it seems to be green for me for in both cases (extension enabled and disabled). Is it different for you?

Sorry, the image doesn't provide an explanation. I mainly want to point out that there is no semantic token in the definition. Its color should be the same as the class used in the main function below, which is blue.

If I disable the Spring Boot plugin and restart VSCode, the Java LSP will correctly return the semantic tokens for the class definitions.

from sts4.

BoykoAlex avatar BoykoAlex commented on July 18, 2024

I have completely removed Spring Boot Tools extension from vscode. Uninstalled and removed from ~/.vscode/extensions/ folder.

This is how vanilla Java syntax highlighting from TextMate + RedHat Java extension semantic highlighting looks like for me

Screenshot 2024-06-05 at 11 56 25

I do see SpringApplication in light blue for a bit but then when Java LS starts ad provides semantic token highlighting the colour turns into green.

Now if I disable all Java related extensions, i.e. to disable Java extension, i.e. Java LS and its semantic token provider i see only the TextMate grammar syntax highlighting which looks like:

Screenshot 2024-06-05 at 12 01 51.

How does this look like for you?

from sts4.

BoykoAlex avatar BoykoAlex commented on July 18, 2024

Do you have any extensions installed beyond the standard Java Extension Pack?

I don't see semantic token type: class when hover over SpringApplication for example.

I see this:

Screenshot 2024-06-05 at 12 23 05

This is VSCode + Java Extension Pack - no Spring extensions of any kind.

I suspect that you have another extension trying to enhance Java syntax highlighting. Multiple semantic token providers for the same language don't work well together.

from sts4.

Skyxim avatar Skyxim commented on July 18, 2024

Do you have any extensions installed beyond the standard Java Extension Pack?

  • Spring Boot Application Development Extension Pack

  • Java Extension Pack

I have only installed these two extensions for Spring Boot development.

My issue depends on whether the Spring Boot Tools is enabled. Once it is enabled and loaded, the problem occurs.

Disable Spring Boot Extension Pack:
image

Enable Spring Boot Extension Pack:
image

from sts4.

BoykoAlex avatar BoykoAlex commented on July 18, 2024

Aa a workaround you could try disabling JPQL support via settings (with the pre-release version)
Screenshot 2024-06-05 at 21 41 00

Might be a better option than disabling the Boot extension.

The hover has:
foreground User settings: class - #339cf

So there must be something overriding the vanilla Java semantic tokens setup. How does your settings.json look like? (The user settings)

from sts4.

Skyxim avatar Skyxim commented on July 18, 2024

Aa a workaround you could try disabling JPQL support via settings (with the pre-release version)

Thank you for the suggestion. I tried it, but it didn’t work.

foreground User settings: class - #339cf

This is the color I set for the class. I expect the class definitions to match the color I’ve set. But due to the loss of semantic tokens, it falls back to a default value.

from sts4.

BoykoAlex avatar BoykoAlex commented on July 18, 2024

@Skyxim can you please try installing spring-boot extension VSIX from https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html
Look for Spring Boot Language Server VSIX at the bottom of the page. Anything after timestamp 202406060451 (not including it) should be okay to try.

from sts4.

Skyxim avatar Skyxim commented on July 18, 2024

@Skyxim can you please try installing spring-boot extension VSIX from https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html Look for Spring Boot Language Server VSIX at the bottom of the page. Anything after timestamp 202406060451 (not including it) should be okay to try.

The semantic token for class declarations are now returning normally. Thank you for your contribution.

from sts4.

BoykoAlex avatar BoykoAlex commented on July 18, 2024

Fixed with 64dc2d0 and a setting as well to switch back to java original semantic tokens d2373fb

from sts4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.