-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
VSCode: Semantic token range off by 1 in store accesses #762
Comments
$ Is because it's transformed into a function in |
Ah, that makes sense. Man, that source-mapping issue is a real thorn in the side. Feel free to close if you feel that this is a duplicate. |
I think there's no previous issue like this so I prefer to keep it open for visibility and to track it. |
If a range is in the same line, and the mapped range has one character more than the original range, add +1 to the end character of the original range. Assumption is that we never alter the length of a mapped token. This "one character short" mapping happens because a range's end is exclusive, so the character at the range's end is not part of the range. That means the end character can be on a character which was added as part of the transformation and is not present in the original output. The mapper rightfully maps this to the first mapped character before it - which means that the range then is one character short. sveltejs#762
If a range is in the same line, and the mapped range has one character more than the original range, add +1 to the end character of the original range. Assumption is that we never alter the length of a mapped token. This "one character short" mapping happens because a range's end is exclusive, so the character at the range's end is not part of the range. That means the end character can be on a character which was added as part of the transformation and is not present in the original output. The mapper rightfully maps this to the first mapped character before it - which means that the range then is one character short. #762
The semantic tokens feature doesn't use the |
Looks like the$
was not accounted for in the range offset.The text was updated successfully, but these errors were encountered: