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-graphql-syntax] Ruby GRAPHQL
heredoc breaks syntax higlighting in the file
#3524
Comments
I was able to fix this locally by removing the ruby syntax addition entirely (edit |
|
if someone wants to fix it, it is just a textmate grammar, so it's a set of regular expressions. should i just remove it for now? is no highlighting better than the current bugs? |
As @krishantaylor said, it’d still get highlighted because Ruby LSP hands it off correctly. (At least for me, you probably need to have the Ruby LSP extension.) It would definitely be better than breaking following Ruby code for the rest of the file. |
I'd rather see it removed. Ruby LSP is the current recommended extension for ruby anyway. |
removal it is! |
here is the proposal to remove ruby and ruby markdown block support! |
Current Behavior
A few weeks ago, the
vscode-graphql-syntax
package added Ruby support (#3490), but I think something is not quite right.This is what the example file
packages/vscode-graphql-syntax/tests/__fixtures__/test.rb
looks like in my VS Code, running the latest extension v1.3.1:As you can see, while the GraphQL is highlighted, it breaks the highlighting of following Ruby code.
Looking at the tests, I noticed how the snapshots for Ruby and e.g. Python are very different.
Ruby (actual GraphQL lines don't have an annotation on the right):
graphiql/packages/vscode-graphql-syntax/tests/__snapshots__/ruby-grammar.spec.ts.snap
Lines 7 to 13 in 25c3bfd
Python (actual GraphQL lines are annotated):
graphiql/packages/vscode-graphql-syntax/tests/__snapshots__/python-grammar.spec.ts.snap
Lines 9 to 14 in 25c3bfd
It looks like the Ruby grammar recognizes the start of the Heredocs also as the end of the Heredoc, maybe confusing itself in the process? I don't understand a lot about the grammars, and fiddling around with the Regexes I wasn't able to produce a better result.
Expected Behavior
I'd expect the closing
GRAPHQL
at the end of the Heredoc to end the code block and reactivate the Ruby syntax highlighting.The text was updated successfully, but these errors were encountered: