-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Python support to the editor plugin (#694)
This depends on the language server supporting Python (PR #693) for IntelliSense. Apollo config defaults to JS/TS files only, so it's required to add `*.py` to `apollo.config.js` under `client.includes` before completion/validation starts to work.
- Loading branch information
1 parent
5f3fb63
commit a1255bc
Showing
3 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"fileTypes": ["python"], | ||
"injectionSelector": "L:source -string -comment", | ||
"patterns": [ | ||
{ | ||
"name": "meta.function-call.python", | ||
"begin": "\\b(gql)\\s*(\\()", | ||
"beginCaptures": { | ||
"1": { | ||
"name": "meta.function-call.generic.python" | ||
}, | ||
"2": { | ||
"name": "punctuation.definition.arguments.begin.python" | ||
} | ||
}, | ||
"end": "(\\))", | ||
"endCaptures": { | ||
"1": { | ||
"name": "punctuation.definition.arguments.end.python" | ||
} | ||
}, | ||
"patterns": [ | ||
{ | ||
"name": "taggedTemplates", | ||
"contentName": "meta.embedded.block.graphql", | ||
"begin": "([bfru]*)((\"(?:\"\")?|'(?:'')?))", | ||
"beginCaptures": { | ||
"1": { | ||
"name": "storage.type.string.python" | ||
}, | ||
"2": { | ||
"name": "string.quoted.multi.python" | ||
}, | ||
"3": { | ||
"name": "punctuation.definition.string.begin.python" | ||
} | ||
}, | ||
"end": "((\\3))", | ||
"endCaptures": { | ||
"1": { | ||
"name": "string.quoted.multi.python" | ||
}, | ||
"2": { | ||
"name": "punctuation.definition.string.end.python" | ||
} | ||
}, | ||
"patterns": [ | ||
{ | ||
"include": "source.graphql" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"scopeName": "inline.graphql.python" | ||
} |