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

feat: allow using the formatter even if "deno.enable" is missing #780

Open
KnorpelSenf opened this issue Dec 30, 2022 · 6 comments
Open
Assignees
Labels

Comments

@KnorpelSenf
Copy link

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.

@Leokuma
Copy link
Contributor

Leokuma commented Jan 7, 2023

Can you provide the steps to reproduce the problem? I was able to format a .d.ts file with the Deno extension.

@KnorpelSenf
Copy link
Author

  1. Open a .d.ts file
  2. Press Ctrl+Shift+I
  3. 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?

@Leokuma
Copy link
Contributor

Leokuma commented Jan 10, 2023

Thanks for the steps.

Ctrl+Shift+I doesn't do anything in my VSC.

Shift+Alt+F works (default VSC shortcut).

@KnorpelSenf
Copy link
Author

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.

@KnorpelSenf
Copy link
Author

KnorpelSenf commented Jan 16, 2023

This is the error I get:
image

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.

@KnorpelSenf KnorpelSenf changed the title feat: format .d.ts files feat: allow using the formatter even if "deno.enable" is missing Jan 16, 2023
@Leokuma
Copy link
Contributor

Leokuma commented Jan 20, 2023

Related #657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants