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

Preconfigure emmet.includeLanguages so it works with svelte out of the box when the extension is installed. #2509

Open
UltraCakeBakery opened this issue Sep 19, 2024 · 2 comments

Comments

@UltraCakeBakery
Copy link

Description

With fresh installs of vscode, you have to manually configure your vscode for emmet to work in svelte, as emmet does not automatically recognize svelte components as HTML.

Proposed solution

The extension when installed should by default apply this setting to vscode:

    "emmet.includeLanguages": {
        "svelte": "html"
    },

Alternatives

Add a command to apply recommended default settings, including the one mentioned above if adding this by default is not preferred.

Additional Information, eg. Screenshots

No response

@jasonlyu123
Copy link
Member

We do have emmet autocomplete and some special handling so I don't think we'll preconfigure the config. That said vue does seems to support emmet commands without needed the config so I'll probably check if we can do the same. If not we can probably considering about the command in the "Alterantives" selection but there is a big problem with feature discovery with this approch.

@jasonlyu123
Copy link
Member

Vue actually doesn't have a special handling for it. It works because the Textmate grammar embeds HTML. Textmate grammar was mainly used in syntax highlight and some embedded language support. However, we went with another approach with a simplified HTML grammar probably because some syntax is not strictly HTML compliant. For example, the arrow in the event handler.

So if we're doing this we might go with the approach in the "Alternatives" section. But as mentioned earlier, there is a feature discovery issue. One is that you won't know the command exists. If users rely on custom keybinding. There's no chance for them to discover the command.

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

No branches or pull requests

2 participants