denoland / vscode_deno

Visual Studio Code plugin for Deno
https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
MIT License
1.5k stars 146 forks source link

Support for `unstable-css` as CSS formatter in VSCode #1153

Closed isAdrisal closed 2 months ago

isAdrisal commented 2 months ago

With Deno 1.46, it's now possible to format CSS styles with Deno:

deno fmt --unstable-css styles.css

This works well, but it doesn't seem supported by the VSCode extension, which means it can't be used to format style on save. Setting denoland.vscode-deno as the default CSS formatter results in this error:

Extension 'Deno' is configured as formatter but it cannot format 'CSS'-files

Describe the solution you'd like

Support for the new unstable-css formatter in the extension – or guidance on how to get it working if it can already.

bartlomieju commented 2 months ago

@nayeemrmn could you handle that?

nayeemrmn commented 2 months ago

Closed by https://github.com/denoland/deno/pull/25353 and #1154.

isAdrisal commented 2 months ago

Hey @nayeemrmn, I think I'm missing a step to get this working.

I have v3.39.0 of the VSCode extension installed, and this in my VSCode settings:

{
  "deno.enable": true,
  "deno.lint": true,
  "deno.unstable": true,
  "editor.formatOnSave": true,
  "[css]": {
      "editor.defaultFormatter": "denoland.vscode-deno"
  }
}

I'm no longer seeing the cannot format 'CSS'-files anymore, but no formatting happens after save of a CSS file. Format on save for js/ts/tsx is working as normal.

Any help would be appreciated :)

bartlomieju commented 2 months ago

@isAdrisal you will have to wait for the next version of Deno to be released, it needs changes in both VSCode extension and the LSP (or upgrade to canary - deno upgrade --canary).

isAdrisal commented 2 months ago

@bartlomieju Makes sense, thanks!