Skip to content

Commit

Permalink
Add ruff server
Browse files Browse the repository at this point in the history
  • Loading branch information
jiz4oh authored and mattn committed Jul 25, 2024
1 parent 4bb4c92 commit 5770bcf
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 3 additions & 0 deletions installer/install-ruff.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

call "%~dp0\pip_install.cmd" ruff ruff
5 changes: 5 additions & 0 deletions installer/install-ruff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

"$(dirname "$0")/pip_install.sh" ruff ruff
16 changes: 16 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 14 additions & 0 deletions settings/ruff.vim
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5770bcf

Please sign in to comment.