Commit ae61981
committed
ecma/injections: support more graphql injection modes
GraphQL injections previously only operated on a 'gql' tagged template
literal, but a few more options are supported by the official VSCode
'GraphQL: Syntax Highlighting' extension:
// Already supported
gql`query { foo }`;
// New
gql('query { foo }');
gql(`query { foo }`);
graphql`query { foo }`;
graphql('query { foo }');
graphql(`query { foo }`);
'#graphql query { foo }';
`#graphql query { foo }`;
/* GraphQL */ 'query { foo }';
/* GraphQL */ `query { foo }`;
Note that until a PR in tree-sitter-typescript[^1] is merged upstream
and updated here, tagged template literals with type arguments (e.g.
'gql<SomeType>`query { foo }`;') won't have a working injection.
supports helix-editor#14413
[^1]: tree-sitter/tree-sitter-typescript#3501 parent 088eb17 commit ae61981
1 file changed
+36
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
32 | 62 | | |
33 | 63 | | |
34 | 64 | | |
| |||
0 commit comments