From 191567ca2a401cdd45bf1d033325845fea35960f Mon Sep 17 00:00:00 2001 From: Jonathan Slenders Date: Fri, 10 Nov 2023 21:27:40 +0000 Subject: [PATCH 1/4] feat: add typos-lsp server configuration --- .../server_configurations/typos_lsp.lua | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lua/lspconfig/server_configurations/typos_lsp.lua diff --git a/lua/lspconfig/server_configurations/typos_lsp.lua b/lua/lspconfig/server_configurations/typos_lsp.lua new file mode 100644 index 0000000000..2cdf9e0c65 --- /dev/null +++ b/lua/lspconfig/server_configurations/typos_lsp.lua @@ -0,0 +1,25 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', +} + +return { + default_config = { + cmd = { 'typos-lsp' }, + filetypes = { '*' }, + root_dir = util.root_pattern(unpack(root_files)) or util.find_git_ancestor(), + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/crate-ci/typos +https://github.com/tekumara/typos-vscode + +A Language Server Protocol implementation for Typos, a low false-positive +source code spell checker, written in Rust. Download it from the releases page +on GitHub: https://github.com/tekumara/typos-vscode/releases + ]], + }, +} From af496c8bdc588542ccf6be03db343c8608e4d56b Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Nov 2023 20:11:46 +0800 Subject: [PATCH 2/4] fixup! --- lua/lspconfig/server_configurations/typos_lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lspconfig/server_configurations/typos_lsp.lua b/lua/lspconfig/server_configurations/typos_lsp.lua index 2cdf9e0c65..69b6cd8cda 100644 --- a/lua/lspconfig/server_configurations/typos_lsp.lua +++ b/lua/lspconfig/server_configurations/typos_lsp.lua @@ -8,7 +8,7 @@ return { default_config = { cmd = { 'typos-lsp' }, filetypes = { '*' }, - root_dir = util.root_pattern(unpack(root_files)) or util.find_git_ancestor(), + root_dir = util.root_pattern('pyproject.toml', '.git'), single_file_support = true, settings = {}, }, From bf0b41f03ade1fb72a693fb4eec8f48c0b1dff98 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Nov 2023 20:11:58 +0800 Subject: [PATCH 3/4] fixup! --- lua/lspconfig/server_configurations/typos_lsp.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/lua/lspconfig/server_configurations/typos_lsp.lua b/lua/lspconfig/server_configurations/typos_lsp.lua index 69b6cd8cda..c012561bcf 100644 --- a/lua/lspconfig/server_configurations/typos_lsp.lua +++ b/lua/lspconfig/server_configurations/typos_lsp.lua @@ -1,8 +1,5 @@ local util = require 'lspconfig.util' -local root_files = { - 'pyproject.toml', -} return { default_config = { From 7122bc549cd1f97e1e10fc987b279fc14e3475d2 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Nov 2023 20:13:07 +0800 Subject: [PATCH 4/4] fixup! --- lua/lspconfig/server_configurations/typos_lsp.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lspconfig/server_configurations/typos_lsp.lua b/lua/lspconfig/server_configurations/typos_lsp.lua index c012561bcf..7d5da0ad66 100644 --- a/lua/lspconfig/server_configurations/typos_lsp.lua +++ b/lua/lspconfig/server_configurations/typos_lsp.lua @@ -1,6 +1,5 @@ local util = require 'lspconfig.util' - return { default_config = { cmd = { 'typos-lsp' },