-
Notifications
You must be signed in to change notification settings - Fork 414
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
Semantic highlighting improvements #1488
Comments
Sure, I'll take it.
Currently it's provided through DocumentSemanticTokensProvider instead of LSP, I think if it's not related with LSP4J. Am I missing anything? |
As far as I know about Java, a method/function should belong to a certain class. As for anonymous lambda function, if a name is assigned, I think the name is of type |
Just FYI, in TypeScript we give all variables that are callable the function type. Example is a callback:
Just mentioning, not sure this applies to Java too. |
What is the reasoning behind using Function func = (x) -> x + 1;
// This is the same as doing:
Function func = new Function() {
@Override
int apply(int x) {
return x + 1;
}
} Again, you cannot directly call the functional interface, because it is not a method, but an anonymous instance of the // This does not work, since "func" is not a method
int result = func(3);
// This is how you use the functional interface:
int result = func.apply(3); So in my opinion, Yes, methods (or functions, if you prefer) are indeed members. But it is more specific to say that they are methods, in order to differentiate them from fields, which is what variable members are usually called in Java. Currently, methods are given the token type |
If the purpose of using I have implemented your suggested improvements, and some more, in eclipse-jdtls/eclipse.jdt.ls#1501. Hopefully my code is ready to merge soon, after which I can submit a pull request for this extension to declare all the new token types and modifiers, as well as their supertypes. |
fixed with eclipse-jdtls/eclipse.jdt.ls#1501 |
Have the following code:
Use the
Developer: Inspect Editor Tokens and Scopes
tool to look at the semantic tokensThe following improvements to semantic highlighting would great to be consistent with TypeScript:
parameter
Color
should beenum
andRED
could beenumMember
SuppressWarnings
could be new typeannotation
(extends type), value should be parameterfunction
, typemember
should be usedtype
, useclass
,interface
....The text was updated successfully, but these errors were encountered: