biomejs/biome-vscode

Enable VSCode for `vue`, `svelte` and `astro` files

Closed this issue · 7 comments

Descriptions

This issue has more background: biomejs/biome#1719

Technical changes

From Discord

For the upcoming partial support of vue, svelte and astro we have to change the VSCode extension. At the moment the extension activates when specific file langauges are opened, but that won't work for astro files
This means that we have to trigger extension in a more generic way, and "disable" it dynamically by checking the extension file that is currently about to open

Why wouldn't that work ? Couldn't we just target the astro and vue languages ?

Screenshot 2024-02-15 at 14 15 41

Unless the documentation is outdated, Astro isn't part of this list: https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers

Oh right it is provided by the Astro extension.

That being said, maybe we can use a pattern instead of a language. I'd have to test.

const documentSelector: DocumentFilter[] = [
	// ...
    { pattern: "**/*.astro", scheme: "file"}
];

Unfortunately, I can't get the document filter to match the files without specifying the language.

Honestly, i don't think it would be too far fetched to ask the users to have the Astro, or Vue extensions installed in their editor.

I opened an issue here microsoft/vscode#205296

Let's hope for the best!

Vue is on the list of known files, but the language filter does not work if the vue extension is not installed, so my guess this only serves to recommend installing the corresponding extension.