From 44295eda38243badb8238caaf07ca33f0ccb74bd Mon Sep 17 00:00:00 2001 From: Seth Daniel Date: Tue, 23 Jan 2024 14:47:09 -0600 Subject: [PATCH] feat: add dprint lsp --- .../server_configurations/dprint.lua | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lua/lspconfig/server_configurations/dprint.lua diff --git a/lua/lspconfig/server_configurations/dprint.lua b/lua/lspconfig/server_configurations/dprint.lua new file mode 100644 index 0000000000..7ef0fad21e --- /dev/null +++ b/lua/lspconfig/server_configurations/dprint.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'dprint', 'lsp' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + 'json', + 'jsonc', + 'markdown', + 'python', + 'toml', + 'rust', + 'roslyn', + }, + root_dir = util.root_pattern('dprint.json', '.dprint.json', 'dprint.jsonc', '.dprint.jsonc'), + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/dprint/dprint + +Pluggable and configurable code formatting platform written in Rust. + ]], + default_config = { + root_dir = util.root_pattern('dprint.json', '.dprint.json', 'dprint.jsonc', '.dprint.jsonc'), + }, + }, +}