vscode_deno
vscode_deno copied to clipboard
feat: allow using the formatter even if `"deno.enable"` is missing
Is your feature request related to a problem? Please describe.
For some libraries I work with .d.ts
files. Many related projects are written in Deno, so I'd like to use the Deno formatter for the .d.ts
files, too. While I can type deno fmt
in the terminal to format the declaration files, the VSCode extension for some reason does not register as a plugin that is able to format the files.
Describe the solution you'd like
Configure this extension as the default formatter for declaration files, and then be able to use it to format the files.
Can you provide the steps to reproduce the problem? I was able to format a .d.ts
file with the Deno extension.
- Open a .d.ts file
- Press Ctrl+Shift+I
- See an error message that no formatter is installed for .d.ts files
I'll try to play around with my setup, perhaps some combination with other extensions breaks this?
Thanks for the steps.
Ctrl+Shift+I doesn't do anything in my VSC.
Shift+Alt+F works (default VSC shortcut).
Right, I'm also using whatever is the default on my machine, but I see that these could differ. Shift+Alt+F doesn't do anything for me. Doing Ctrl+Shift+P and formatting the code via that panel used to reproduce the issue, too.
I didn't find time to play around further with this, will get back to you then.
This is the error I get:
I now also found out why the formatter isn't available. I am only allowed to use it if the Deno extension is enabled for the respective project. This behaviour is understandable for many other LSP features, but IMO formatting in particular should be an exception here.
Related #657