-
Notifications
You must be signed in to change notification settings - Fork 417
malformed semantic tokens in some case #1922
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
Comments
The tokens aren't unsorted, the problem is that JDT Core seems to think that I thought we could skip resolving the type binding and just check the flags on the type literal node to find out if it's recovered, but it seems like that doesn't work in this specific case (I think that's a bug with JDT Core, right?). But the type binding does contain the correct information about it being recovered, so we can use that instead. I've submitted a PR, see #1924. |
Actually we still need to check if the |
Hmm, actually relying on whether or not the binding is recovered only helps in this case, but it won't work if the type binding isn't recovered: public class MatriksSatuClass {
public static int[][] setBaris(int[][] m, int baris) {
int[][] newNilai = new int[baris][int[]];
}
} Here you can see that I am planning to implement more robust semantic highlighting for keywords, which can cover this edge case correctly and highlight other keywords, but I don't have time to spend on that right now. Edit: I came up with a workaround. |
@0dinD Thank you for the investigation and quick response.
Then probably we should fire a bug in upstream project. And the workaround looks fine to me before we get it fixed in upsteam. |
Open this java file in an empty folder:
The last semantic token is malformed as below:
We are producing unsorted tokens.
references:
microsoft/vscode#135079
microsoft/vscode#134973
microsoft/vscode-java-pack#764 (comment)
The text was updated successfully, but these errors were encountered: