Skip to content

fix: vscode file template scope#15943

Merged
Princesseuh merged 4 commits into
withastro:mainfrom
alexanderdombroski:vscode-file-templates
Mar 17, 2026
Merged

fix: vscode file template scope#15943
Princesseuh merged 4 commits into
withastro:mainfrom
alexanderdombroski:vscode-file-templates

Conversation

@alexanderdombroski
Copy link
Copy Markdown
Contributor

Changes

Update VS Code extension file template snippets to be scoped to astro files.

file template expansion

Without this change, VS Code will recommend the astro file templates inside the svelte (or any) file.

Info about file pattern scope

VS Code added file pattern scope to their snippets engine in v1.109. (latest is v1.111). File templates can be glob scoped to their correct file type for better UX/DX.

This change won't affect VS Code forks like Kiro, Cursor, or Antigravity or VS Code versions older than v1.109 until they update to v1.109+.

Testing

I tested the change locally in the dev environment. I couldn't get the automated test runner to work on my MacBook, and it doesn't look like there are automated tests that need updated.

Docs

Added bullet point readme item for snippets and file templates. File templates are provided by the edited .code-snippets file and snippets from language server installed with the extension

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 16, 2026

🦋 Changeset detected

Latest commit: cd4f5b9

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alexanderdombroski alexanderdombroski changed the title Fix VS Code file template scope fix: vscode file template scope Mar 16, 2026
Copy link
Copy Markdown
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you!

@Princesseuh Princesseuh merged commit 1a627e2 into withastro:main Mar 17, 2026
24 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 17, 2026
@alexanderdombroski alexanderdombroski deleted the vscode-file-templates branch March 17, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants