-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
[New Tree-Sitter] In the Ruby grammar, "/regex/" only makes colors correct if the "/" is on the first column of the row #420
Comments
On the newer tree-sitter grammar, the following code colorizes both /test/ But this one doesn't: /test/ |
The problem is that detectCoveredScope is a really brittle heuristic. The purpose behind it was the idea that whenever an injection covers a region of the buffer, its scopes should preempt the scopes from a shallower layer. In this case, the idea is that we want the regex injection layer to add scopes to the regex instead of however the Ruby grammar would scope them — save for at the very boundaries of the injection, where an attempt is made to apply both sets of scopes. But it only detects situations where a shallower layer wants to open or close a scope at the same position as the deeper layer. This makes it quite easy for opening and closing scopes to get unbalanced and out of whack. This problem theoretically exists in the legacy Commenting out all calls to
The So I'm going to comment out any calls to |
@mauricioszabo I think this is fixed. Can you still reproduce it? |
OK, the most recent commit in #677 should fix this. Syntax highlighting is now equivalent in appearance to that of the TextMate grammar. |
No description provided.
The text was updated successfully, but these errors were encountered: