Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Improve GraphQL regex to match 'GQL'
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorascorrea committed Feb 2, 2024
1 parent ca4f02a commit 84385bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions grammars/ruby.cson.json
Original file line number Diff line number Diff line change
Expand Up @@ -1671,13 +1671,13 @@
]
},
{
"begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)GRAPHQL)\\b\\1))",
"begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)(?:GRAPHQL|GQL))\\b\\1))",
"comment": "Heredoc with embedded GraphQL",
"end": "(?!\\G)",
"name": "meta.embedded.block.graphql",
"patterns": [
{
"begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)GRAPHQL)\\b\\1)",
"begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)(?:GRAPHQL|GQL))\\b\\1)",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.ruby"
Expand Down
5 changes: 4 additions & 1 deletion src/test/suite/grammars.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const EMBEDDED_HEREDOC_LANGUAGES: InferrableLanguageConfigOrLabel[] = [
// Languages for which we can infer everything from the comment label
"C",
"CSS",
"GraphQL",
"Lua",
"Ruby",
"SQL",
Expand All @@ -37,6 +36,10 @@ const EMBEDDED_HEREDOC_LANGUAGES: InferrableLanguageConfigOrLabel[] = [
id: "cpp",
label: "C++",
},
{
label: "GraphQL",
delimiters: ["GRAPHQL", "GQL"],
},
{
label: "HAML",
contentName: "text.haml",
Expand Down

0 comments on commit 84385bf

Please sign in to comment.