Skip to content

Commit

Permalink
feat: add astro support for vscode extension
Browse files Browse the repository at this point in the history
  • Loading branch information
XiNiHa committed Jan 20, 2024
1 parent 61e2ee0 commit 934d21c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/grumpy-moles-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'graphql-language-service-server': minor
'vscode-graphql': minor
'vscode-graphql-syntax': minor
---

Add Astro file support
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ yoshiakis

// packages and tools
argparse
astro
changesets
clsx
codemirror
Expand Down
4 changes: 3 additions & 1 deletion packages/vscode-graphql/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ build({
outdir: 'out/',
format: 'cjs',
sourcemap: true,
// Avoid bundling @vue/compiler-sfc's dynamic dependencies
external: [
// Avoid bundling @astrojs/compiler since esbuild can't handle WASM correctly
'@astrojs/compiler',
// Avoid bundling @vue/compiler-sfc's dynamic dependencies
'squirrelly',
'teacup',
'coffee-script',
Expand Down
1 change: 1 addition & 0 deletions packages/vscode-graphql/src/apis/statusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const statusBarActivationLanguageIds = [
'typescriptreact',
'vue',
'svelte',
'astro',
];

export const createStatusBar = () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/vscode-graphql/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export async function activate(context: ExtensionContext) {
{ scheme: 'file', language: 'vue' },
{ scheme: 'file', language: 'vue-html' },
{ scheme: 'file', language: 'svelte' },
{ scheme: 'file', language: 'astro' },
],
synchronize: {
// TODO: This should include any referenced graphql files inside the graphql-config
Expand All @@ -77,7 +78,7 @@ export async function activate(context: ExtensionContext) {
// TODO: load ignore
// These ignore node_modules and .git by default
workspace.createFileSystemWatcher(
'**/{*.graphql,*.graphqls,*.gql,*.js,*.mjs,*.cjs,*.esm,*.es,*.es6,*.jsx,*.ts,*.tsx,*.vue,*.svelte,*.cts,*.mts,*.json}',
'**/{*.graphql,*.graphqls,*.gql,*.js,*.mjs,*.cjs,*.esm,*.es,*.es6,*.jsx,*.ts,*.tsx,*.vue,*.svelte,*.cts,*.mts,*.json,*.astro}',
),
],
},
Expand Down

0 comments on commit 934d21c

Please sign in to comment.