From 4e13145980526a0296cde2d98cff6e898b1f2fad Mon Sep 17 00:00:00 2001 From: Igor Lacerda <84649544+igorlfs@users.noreply.github.com> Date: Tue, 20 Dec 2022 22:27:38 -0300 Subject: feat: add ruff-lsp support (#2335) --- lua/lspconfig/server_configurations/ruff-lsp.lua | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lua/lspconfig/server_configurations/ruff-lsp.lua (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/ruff-lsp.lua b/lua/lspconfig/server_configurations/ruff-lsp.lua new file mode 100644 index 00000000..f2bfc3b0 --- /dev/null +++ b/lua/lspconfig/server_configurations/ruff-lsp.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'pyproject.toml', +} + +return { + default_config = { + cmd = { 'ruff-lsp' }, + filetypes = { 'python' }, + root_dir = util.root_pattern(unpack(root_files)) or util.find_git_ancestor(), + single_file_support = true, + settings = {}, + }, + docs = { + description = [[ +https://github.com/charliermarsh/ruff-lsp + +A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code transformation tool, written in Rust. It can be installed via pip + +```sh +pip install ruff-lsp +``` + +Extra CLI arguments for `ruff` can be provided via + +```lua +require'lspconfig'.ruff_lsp.setup{ + settings = { + ruff_lsp = { + -- Any extra CLI arguments for `ruff` go here. + args = {}, + } + } +} +``` + + ]], + }, +} -- cgit v1.2.3-70-g09d2