Giter Club home page Giter Club logo

Comments (5)

testforstephen avatar testforstephen commented on June 12, 2024 1

If you use the command "Developer: Inspect Editor Tokens and Scopes" to inspect the token type, you can see that we already assign different semantic token types for them. For the field, its semantic token type is property, and for the variable, its semantic token type is variable. It's the color theme that's responsible for rendering the color highlighting.

A workaround for you is to customize the semantic highlighting color in the settings.json by yourself.

"editor.semanticTokenColorCustomizations": {
        "[Default Light Modern]": {
            "rules": {
                "property": "#9089f4"
            }
        }
    }

image

from vscode-java.

rgrunber avatar rgrunber commented on June 12, 2024

Makes sense. I would actually go further, and say the highlighting doesn't even distinguish between class fields and other variables. For example, Eclipse clearly does this :

VS Code Java
image

Eclipse JDT
image

Note : Obviously, we can't fix this in the grammar, but our semantic highlighting (language server) is definitely able to deal with this. @testforstephen any reason not to do this ?

from vscode-java.

rgrunber avatar rgrunber commented on June 12, 2024

Thanks for looking into this!

In fact, even the lambda parameter has a semantic token type of parameter, so this can all be fixed with something like :

"editor.semanticTokenColorCustomizations": {
        "[Default Light Modern]": {
            "rules": {
                "property": "#9089f4",
                "parameter": "#9089f4"
            }
        }
    }

Screenshot from 2024-04-16 10-19-14

@Phoenix-Starlight , let us know if this works for you. It would have to be configured per-theme. See https://code.visualstudio.com/docs/getstarted/themes#_editor-semantic-highlighting .

from vscode-java.

rgrunber avatar rgrunber commented on June 12, 2024

Closing this for now as it's mainly an issue with the themes provided, and there is a way to configure.

from vscode-java.

Phoenix-Starlight avatar Phoenix-Starlight commented on June 12, 2024

Hi, I'm back again. Another case is

public bar(Foo foo) {
  pack(() -> foo);
}

This captures the parameter foo, but there is no way to distinguish this.

from vscode-java.

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.