mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-12 20:35:54 +01:00
Add RuboCop lsp mode.
This commit is contained in:
@@ -155,6 +155,7 @@ You can change the directory to install servers by set `g:lsp_settings_servers_d
|
||||
| Ruby | solargraph | Yes | Yes |
|
||||
| Ruby | steep | Yes | Yes |
|
||||
| Ruby | typeprof | Yes | Yes |
|
||||
| Ruby | rubocop (lsp mode) | Yes | No |
|
||||
| Rust | rls | Yes | No |
|
||||
| Rust | rust-analyzer | Yes | Yes |
|
||||
| Sphinx | esbonio | Yes | Yes |
|
||||
@@ -299,6 +300,10 @@ To use older version `golangci-lint`, please run `:LspSettingsGlobalEdit` and pu
|
||||
}
|
||||
```
|
||||
|
||||
### [rubocop lsp mode (Ruby)](https://docs.rubocop.org/rubocop/usage/lsp.html)
|
||||
|
||||
To use rubocop-lsp-mode, you need to install rubocop in your Ruby project using bundler.
|
||||
|
||||
## Extra Configurations
|
||||
|
||||
Most of the configurations are not required.
|
||||
|
||||
18
installer/install-rubocop-lsp-mode.cmd
Normal file
18
installer/install-rubocop-lsp-mode.cmd
Normal file
@@ -0,0 +1,18 @@
|
||||
@echo off
|
||||
|
||||
echo @echo off ^
|
||||
|
||||
setlocal ^
|
||||
|
||||
set TARGET_DIR=%%1 ^
|
||||
|
||||
shift ^
|
||||
|
||||
cd %%TARGET_DIR%% ^
|
||||
|
||||
bundle exec rubocop %%* ^
|
||||
|
||||
> rubocop-lsp-mode.cmd
|
||||
|
||||
echo Install Done.
|
||||
echo **You need add rubocop dependencies in Gemfile.**
|
||||
17
installer/install-rubocop-lsp-mode.sh
Executable file
17
installer/install-rubocop-lsp-mode.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cat <<EOF >rubocop-lsp-mode
|
||||
#!/bin/sh
|
||||
|
||||
TARGET_DIR=\$1
|
||||
shift
|
||||
cd \${TARGET_DIR}
|
||||
bundle exec rubocop \$*
|
||||
EOF
|
||||
|
||||
chmod +x rubocop-lsp-mode
|
||||
|
||||
echo 'Install Done.'
|
||||
echo '**You need add rubocop dependencies in Gemfile.**'
|
||||
@@ -1335,6 +1335,17 @@
|
||||
"requires": [
|
||||
"gem"
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "rubocop-lsp-mode",
|
||||
"url": "https://github.com/rubocop/rubocop",
|
||||
"description": "A Ruby static code analyzer and formatter, based on the community Ruby style guide.",
|
||||
"requires": [
|
||||
"bundle"
|
||||
],
|
||||
"root_uri_patterns": [
|
||||
"Gemfile"
|
||||
]
|
||||
}
|
||||
],
|
||||
"rust": [
|
||||
|
||||
14
settings/rubocop-lsp-mode.vim
Normal file
14
settings/rubocop-lsp-mode.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
augroup vim_lsp_settings_rubocop_vim_ls
|
||||
au!
|
||||
LspRegisterServer {
|
||||
\ 'name': 'rubocop-lsp-mode',
|
||||
\ 'cmd': {server_info->lsp_settings#get('rubocop-lsp-mode', 'cmd', [lsp_settings#exec_path('rubocop-lsp-mode'), lsp#utils#uri_to_path(lsp_settings#root_uri('rubocop-lsp-mode')), '--lsp'])+lsp_settings#get('rubocop-lsp-mode', 'args', [])},
|
||||
\ 'root_uri':{server_info->lsp_settings#get('rubocop-lsp-mode', 'root_uri', lsp_settings#root_uri('rubocop-lsp-mode'))},
|
||||
\ 'initialization_options': lsp_settings#get('rubocop-lsp-mode', 'initialization_options', v:null),
|
||||
\ 'allowlist': lsp_settings#get('rubocop-lsp-mode', 'allowlist', ['ruby']),
|
||||
\ 'blocklist': lsp_settings#get('rubocop-lsp-mode', 'blocklist', []),
|
||||
\ 'config': lsp_settings#get('rubocop-lsp-mode', 'config', lsp_settings#server_config('rubocop-lsp-mode')),
|
||||
\ 'workspace_config': lsp_settings#get('rubocop-lsp-mode', 'workspace_config', {}),
|
||||
\ 'semantic_highlight': lsp_settings#get('rubocop-lsp-mode', 'semantic_highlight', {}),
|
||||
\ }
|
||||
augroup END
|
||||
Reference in New Issue
Block a user