Closed harrysolovay closed 3 days ago
@nayeemrmn please take a look - I believe this should be possible with just VSCode settings to enable Deno as a default formatter
Using the formatter requires starting the language server and syncing docs with it. Instead, you should use https://marketplace.visualstudio.com/items?itemName=dprint.dprint which is the library deno fmt
uses.
I've been using dprint, but I see the latest Deno release has a sql formatter baked in. I've been using dprint-plugin-exec to trigger sql-formatter, but it's a little laggy. I'd prefer to use deno fmt
now that it supports sql (even though it's technically unstable). I know it's nothing mission critical, but I believe this should be doable (using tools of the Deno toolchain independently of one another).
@harrysolovay FYI deno fmt
SQL support is based on https://github.com/shssoichiro/sqlformat-rs - it should be fairly straightforward to create a dprint
plugin for it.
Unfortunately we don't have bandwidth at this point to maintain a completely different VSCode plugin that would allow us to only run deno fmt
instead of spawning the whole language server.
Makes sense. Thank you for your consideration!
I'd like to use Deno's formatter with VSCode + my Node project. Unfortunately, when I create a
deno.json
with my preferred formatting configuration, Deno overrides the default TS language server. If I specifyexclude: ["."]
to disable the language server for my project files, the formatting no longer applies to any of the files. I'm wondering if there's a way to utilize the Deno formatter without enabling the language server? I'd also be partial to doing this within the.vscode/settings.json
to avoid need of thedeno.json
file.This would break usage of the
deno fmt
command. So perhaps there could also be a--vscode-settings
flag to tell Deno'sfmt
command to look inside of the.vscode/settings.json
for the configuration.Thoughts?