Add ruff server

This commit is contained in:
jiz4oh
2024-07-19 23:56:08 +08:00
committed by mattn
parent 4bb4c92db4
commit 5770bcf9af
5 changed files with 39 additions and 0 deletions

View File

@@ -153,6 +153,7 @@ You can change the directory to install servers by set `g:lsp_settings_servers_d
| Python | pylsp-all (pylsp with dependencies) | Yes | Yes |
| Python | pylsp (pylsp without dependencies) | Yes | Yes |
| Python | pylyzer | Yes | Yes |
| Python | ruff | Yes | Yes |
| Python | ruff-lsp | Yes | Yes |
| Prisma | prisma-language-server | Yes | Yes |
| R | languageserver | Yes | No |

View File

@@ -0,0 +1,3 @@
@echo off
call "%~dp0\pip_install.cmd" ruff ruff

5
installer/install-ruff.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
set -e
"$(dirname "$0")/pip_install.sh" ruff ruff

View File

@@ -1386,6 +1386,22 @@
"python3"
]
},
{
"command": "ruff",
"url": "https://github.com/astral-sh/ruff",
"description": "A language server written in Rust and built into Ruff.",
"requires": [
"py"
]
},
{
"command": "ruff",
"url": "https://github.com/astral-sh/ruff",
"description": "A language server written in Rust and built into Ruff.",
"requires": [
"python3"
]
},
{
"command": "ruff-lsp",
"url": "https://github.com/charliermarsh/ruff-lsp",

14
settings/ruff.vim Normal file
View File

@@ -0,0 +1,14 @@
augroup vim_lsp_settings_ruff
au!
LspRegisterServer {
\ 'name': 'ruff',
\ 'cmd': {server_info->lsp_settings#get('ruff', 'cmd', [lsp_settings#exec_path('ruff')]+lsp_settings#get('ruff', 'args', ['server']))},
\ 'root_uri':{server_info->lsp_settings#get('ruff', 'root_uri', lsp_settings#root_uri('ruff'))},
\ 'initialization_options': lsp_settings#get('ruff', 'initialization_options', v:null),
\ 'allowlist': lsp_settings#get('ruff', 'allowlist', ['python']),
\ 'blocklist': lsp_settings#get('ruff', 'blocklist', []),
\ 'config': lsp_settings#get('ruff', 'config', lsp_settings#server_config('ruff')),
\ 'workspace_config': lsp_settings#get('ruff', 'workspace_config', {}),
\ 'semantic_highlight': lsp_settings#get('ruff', 'semantic_highlight', {}),
\ }
augroup END