Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add svelte sfc support #17

Merged
merged 3 commits into from Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -137,7 +137,8 @@
"source.ts",
"source.js.jsx",
"source.tsx",
"source.vue"
"source.vue",
"source.svelte"
],
"scopeName": "inline.graphql",
"path": "./syntaxes/graphql.js.json",
Expand Down
3 changes: 2 additions & 1 deletion src/language-server/document.ts
Expand Up @@ -65,7 +65,8 @@ export function extractGraphQLDocuments(
case "typescript":
case "typescriptreact":
case "vue":
return extractGraphQLDocumentsFromJSTemplateLiterals(document, tagName);
case "svelte":
return extractGraphQLDocumentsFromJSTemplateLiterals(document, tagName);
jgzuke marked this conversation as resolved.
Show resolved Hide resolved
case "python":
return extractGraphQLDocumentsFromPythonStrings(document, tagName);
case "ruby":
Expand Down
1 change: 1 addition & 0 deletions src/language-server/project/base.ts
Expand Up @@ -50,6 +50,7 @@ const fileAssociations: { [extension: string]: string } = {
".jsx": "javascriptreact",
".tsx": "typescriptreact",
".vue": "vue",
".svelte": "svelte",
".py": "python",
".rb": "ruby",
".dart": "dart",
Expand Down
3 changes: 2 additions & 1 deletion src/languageServerClient.ts
Expand Up @@ -47,6 +47,7 @@ export function getLanguageServerClient(
"javascriptreact",
"typescriptreact",
"vue",
"svelte",
"python",
"ruby",
"dart",
Expand All @@ -57,7 +58,7 @@ export function getLanguageServerClient(
fileEvents: [
workspace.createFileSystemWatcher("**/.env?(.local)"),
workspace.createFileSystemWatcher(
"**/*.{graphql,js,ts,jsx,tsx,vue,py,rb,dart,re,ex,exs}"
"**/*.{graphql,js,ts,jsx,tsx,vue,svelte,py,rb,dart,re,ex,exs}"
),
],
},
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/graphql.js.json
@@ -1,5 +1,5 @@
{
"fileTypes": ["js", "jsx", "ts", "tsx", "vue"],
"fileTypes": ["js", "jsx", "ts", "tsx", "vue", "svelte"],
"injectionSelector": "L:source -string -comment",
"patterns": [
{
Expand Down