Skip to content

Commit

Permalink
feat: add syntax highlighting in Scala
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-vrijswijk committed Mar 20, 2023
1 parent 05c16b9 commit 5c6f646
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
75 changes: 75 additions & 0 deletions packages/vscode-graphql-syntax/grammars/graphql.scala.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"fileTypes": ["scala"],
"injectionSelector": "L:source -string -comment",
"patterns": [
{
"contentName": "meta.embedded.block.graphql",
"begin": "(gql|graphql)(\"\"\")",
"beginCaptures": {
"1": {
"name": "keyword.interpolation.scala"
},
"2": {
"name": "string.quoted.triple.scala"
}
},
"end": "(\"\"\")",
"endCaptures": {
"1": {
"name": "string.quoted.triple.scala"
}
},
"patterns": [
{
"include": "source.graphql"
}
]
},
{
"contentName": "meta.embedded.block.graphql",
"begin": "(gql|graphql)(\")",
"beginCaptures": {
"1": {
"name": "keyword.interpolation.scala"
},
"2": {
"name": "string.quoted.double.scala"
}
},
"end": "(\")",
"endCaptures": {
"1": {
"name": "string.quoted.double.scala"
}
},
"patterns": [
{
"include": "source.graphql"
}
]
},
{
"begin": "(\"\"\")(#graphql)",
"beginCaptures": {
"1": {
"name": "string.quoted.triple.scala"
},
"2": {
"name": "comment.line.graphql.js"
}
},
"end": "(\"\"\")",
"endCaptures": {
"1": {
"name": "string.quoted.triple.scala"
}
},
"patterns": [
{
"include": "source.graphql"
}
]
}
],
"scopeName": "inline.graphql.scala"
}
10 changes: 10 additions & 0 deletions packages/vscode-graphql-syntax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@
"embeddedLanguages": {
"meta.embedded.block.graphql": "graphql"
}
},
{
"injectTo": [
"source.scala"
],
"scopeName": "inline.graphql.scala",
"path": "./grammars/graphql.scala.json",
"embeddedLanguages": {
"meta.embedded.block.graphql": "graphql"
}
}
]
},
Expand Down

0 comments on commit 5c6f646

Please sign in to comment.