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

Extension 'Deno' .... cannot format 'JavaScript' files #657

Closed
piscisaureus opened this issue Apr 19, 2022 · 5 comments
Closed

Extension 'Deno' .... cannot format 'JavaScript' files #657

piscisaureus opened this issue Apr 19, 2022 · 5 comments
Labels
wontfix This will not be worked on

Comments

@piscisaureus
Copy link
Member

piscisaureus commented Apr 19, 2022

Happened while working on Deploy; deno had not been enabled in the vscode workspace.
However I don't think we should refuse to format files when asked.

screenshot

image

version info

  • deno v1.20.6
  • vscode 1.66.2
  • vscode-deno v3.12.0
@vanntile
Copy link

It might be because it can't do "modifications" type formatting, from your VSCode settings. Try adding "editor.formatOnSaveMode": "file" in your workspace's settings.json

@kitsonk
Copy link
Contributor

kitsonk commented Jul 8, 2022

The format function is independent from a workspace being disable or enabled for Deno. This is effectively expected and the formatting can be configured independently. For example, I have Deno as my default formatter, irrespective of the project being enabled, replacing prettier.

@eric-burel
Copy link

eric-burel commented Aug 31, 2022

I am still a bit confused on how to pick the right formatter only for the Deno subpath, eg I have a mono repo with a Deno "/api" and a classival Vite "/webapp":

{
    "deno.enable": true,
    "deno.unstable": true,
    "deno.codeLens.implementations": true,
    "deno.codeLens.referencesAllFunctions": true,
    "deno.importMap": "./api/import_map.json"
}

How can I use "deno" as the default formatter for the "./api" folder (if it's even possible)?

Also I hit a "Deno cannot format TypeScript files error" when trying to format with Vim "==" (I remember something about it, like it call formatting at line level and not file thus needing another config or smth like that)

@bartlomieju
Copy link
Member

Seems exactly the same as #840

@bartlomieju
Copy link
Member

Please see #860 (comment)

@bartlomieju bartlomieju added wontfix This will not be worked on and removed needs info labels Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants