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

HTML formatter doesn't work without opening JS/TS file #1266

Open
mfulton26 opened this issue Mar 1, 2025 · 3 comments
Open

HTML formatter doesn't work without opening JS/TS file #1266

mfulton26 opened this issue Mar 1, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@mfulton26
Copy link

Is your feature request related to a problem? Please describe.

Deno CLI supports formatting HTML files now but VS Code doesn't recognize vscode_deno as an HTML formatter.

Describe the solution you'd like

Ability to format code in VS Code using vscode_deno.

@nayeemrmn
Copy link
Collaborator

This should be supported, can you share the error you're seeing?

@mfulton26
Copy link
Author

There is no formatter for 'html' files installed.

I think I might have an idea of what is happening though. If I open VS Code and open an HTML file I will get the alert that there is no formatter for 'html' files installed but if I open a TS file, format it with Deno, and then come back to the HTML file it then works as expected.

In fact, if I reload the developer window in VS Code and immediately try to format a TS file I will get the same alert. It is as if Deno is lazily loaded as a formatter and fails to get registered on HTML files but does eventually get registered on TS files and once registered it works as expected on HTML files but only if a TS file is formatted first.

@nayeemrmn
Copy link
Collaborator

Oh, it's because the language server isn't being started because a JS/TS file hasn't been opened yet...

@nayeemrmn nayeemrmn added enhancement New feature or request and removed needs info labels Mar 3, 2025
@nayeemrmn nayeemrmn changed the title HTML formatter HTML formatter doesn't work without opening JS/TS file Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants