Comments (5)
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"
}
}
}
from vscode-java.
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 :
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.
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"
}
}
}
@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.
Closing this for now as it's mainly an issue with the themes provided, and there is a way to configure.
from vscode-java.
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)
- [Navigation Breadcrumbs] - Not Available in library classes
- [Bug - Go To/Navigation Java Records] - Can not go to Class
- [Bug - Autocompletion] - Does not work with Record implements Interface
- [Bug - Go To/Navigation/References] - Does not work for Private Methods/Constructor
- Show call hierarchy with lambda functions doesn't show the full stack call
- Gradle 8.6 and 8.7 are unsupported HOT 5
- Language Support Fails to Start on MacOS: Error: Unable to generate a random pipe name with 7 characters. HOT 4
- vscode Java no definition found no references found Java HOT 1
- Cannot Commit HOT 1
- Support debug on SpyBeans HOT 5
- Java language sever only opens for user with id=1000 on wsl HOT 1
- Static import quick fix offered on unrelated error HOT 1
- Base class methods are missing when generating override methods with source action. HOT 3
- Preview features enabled at an invalid source release level 21, preview can be enabled only at source level 22 HOT 2
- JDK config in both windows and linux HOT 7
- Extension download and install failing with msg "corrupt zip". HOT 2
- Import from code actions doesn't work well after delete java file which is created from code actions
- Cursor jumps when typing HOT 1
- ISSUE: Language Support for Java doesn't work properly, it shows unnecessary error underlines HOT 3
- Maven multi-module project mapstruct duplicate generation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-java.