fannheyward / coc-deno

Deno extension for coc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for vscode-style format-on-save

filmaj opened this issue · comments

Hello, thanks for the awesome project!

I am looking into how to set up format-on-save.. I saw the other issue in this repo (#73) on this topic, but it seems that solution requires installing and using a separate plugin.

However, the vscode extension does not require that, I don't think. So, I wonder if similar support could be added to this plugin?

For example, based on this issue in the vscode deno plugin, it seems the following is valid configuration and works in the vscode extension:

{
  "deno.enable": true,
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "denoland.vscode-deno"
}

Additionally, it seems the vscode extension also supports a [typescript] directive to allow only format-on-save in .ts files:

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

The reason I ask is that I work on a variety of deno projects and these projects have the vscode settings embedded in version control (see an example of the project's .vscode/settings.json here). It would be super cool if I could just re-use these settings with coc-deno!

What do you think?