File tree 7 files changed +121
-0
lines changed
packages/vscode-graphql-syntax
7 files changed +121
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "scopeName" : " inline.graphql.dart" ,
3
+ "injectionSelector" : " L:(meta.embedded.block.dart | source.dart -string -comment)" ,
4
+ "patterns" : [
5
+ {
6
+ "begin" : " (''')(#graphql)" ,
7
+ "beginCaptures" : {
8
+ "1" : {
9
+ "name" : " string.interpolated.triple.single.dart"
10
+ },
11
+ "2" : {
12
+ "name" : " comment.line.graphql.js"
13
+ }
14
+ },
15
+ "end" : " (''')" ,
16
+ "endCaptures" : {
17
+ "1" : {
18
+ "name" : " string.interpolated.triple.single.dart"
19
+ }
20
+ },
21
+ "patterns" : [
22
+ {
23
+ "include" : " source.graphql"
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "begin" : " (\"\"\" )(#graphql)" ,
29
+ "beginCaptures" : {
30
+ "1" : {
31
+ "name" : " string.interpolated.triple.double.dart"
32
+ },
33
+ "2" : {
34
+ "name" : " comment.line.graphql.js"
35
+ }
36
+ },
37
+ "end" : " (\"\"\" )" ,
38
+ "endCaptures" : {
39
+ "1" : {
40
+ "name" : " string.interpolated.triple.double.dart"
41
+ }
42
+ },
43
+ "patterns" : [
44
+ {
45
+ "include" : " source.graphql"
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
Original file line number Diff line number Diff line change
1
+ const test = """#graphql
2
+
3
+ """ ;
4
+
5
+ const tet = '''#graphql
6
+ ''' ;
Original file line number Diff line number Diff line change 136
136
"embeddedLanguages" : {
137
137
"meta.embedded.block.graphql" : " graphql"
138
138
}
139
+ },
140
+ {
141
+ "injectTo" : [
142
+ " source.dart" ,
143
+ " text.html.markdown"
144
+ ],
145
+ "scopeName" : " inline.graphql.dart" ,
146
+ "path" : " ./grammars/graphql.dart.json" ,
147
+ "embeddedLanguages" : {
148
+ "meta.embedded.block.graphql" : " graphql"
149
+ }
139
150
}
140
151
]
141
152
},
Original file line number Diff line number Diff line change
1
+ const query1 = '''#graphql
2
+ query {
3
+ id
4
+ }
5
+ ''' ;
6
+
7
+ const query2 = """#graphql
8
+ query {
9
+ id
10
+ }
11
+ """ ;
Original file line number Diff line number Diff line change 61
61
name
62
62
}
63
63
}"""
64
+
Original file line number Diff line number Diff line change
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports [` inline.graphql.dart grammar > should tokenize a simple dart file 1` ] = `
4
+ const query1 = |
5
+ ''' | string.interpolated.triple.single.dart
6
+ #graphql | comment.line.graphql.js
7
+ |
8
+ query | keyword.operation.graphql
9
+ | meta.selectionset.graphql
10
+ { | meta .selectionset .graphql punctuation .operation .graphql
11
+ | meta .selectionset .graphql
12
+ id | meta .selectionset .graphql variable .graphql
13
+ | meta .selectionset .graphql
14
+ } | meta.selectionset.graphql punctuation.operation.graphql
15
+ ''' | string.interpolated.triple.single.dart
16
+ ; |
17
+ |
18
+ const query2 = |
19
+ """ | string.interpolated.triple.double.dart
20
+ #graphql | comment.line.graphql.js
21
+ |
22
+ query | keyword.operation.graphql
23
+ | meta.selectionset.graphql
24
+ { | meta .selectionset .graphql punctuation .operation .graphql
25
+ | meta .selectionset .graphql
26
+ id | meta .selectionset .graphql variable .graphql
27
+ | meta .selectionset .graphql
28
+ } | meta.selectionset.graphql punctuation.operation.graphql
29
+ """ | string.interpolated.triple.double.dart
30
+ ; |
31
+ |
32
+ ` ;
Original file line number Diff line number Diff line change
1
+ import { tokenizeFile } from './__utilities__/utilities' ;
2
+
3
+ describe ( 'inline.graphql.dart grammar' , ( ) => {
4
+ const scope = 'inline.graphql.dart' ;
5
+
6
+ it ( 'should tokenize a simple dart file' , async ( ) => {
7
+ const result = await tokenizeFile ( '__fixtures__/test.dart' , scope ) ;
8
+ expect ( result ) . toMatchSnapshot ( ) ;
9
+ } ) ;
10
+ } ) ;
You can’t perform that action at this time.
0 commit comments