[feat] change rust lsp setting

This commit is contained in:
Jay 2020-09-19 21:10:42 +08:00
parent 35b35ea6af
commit 263f59ca76

15
.vimrc
View File

@ -214,6 +214,7 @@ nmap <Leader>w <Plug>(easymotion-overwin-w)
let g:ale_linters = { let g:ale_linters = {
\ 'javascript': ['standard'], \ 'javascript': ['standard'],
\ 'go': ['gopls'], \ 'go': ['gopls'],
\ 'rust': ['analyzer'],
\} \}
let g:ale_fixers = {'javascript': ['standard']} let g:ale_fixers = {'javascript': ['standard']}
let g:ale_lint_on_save = 1 let g:ale_lint_on_save = 1
@ -278,10 +279,18 @@ endif
" rustup update " rustup update
" rustup component add rls rust-analysis rust-src " rustup component add rls rust-analysis rust-src
if executable('rls') " if executable('rls')
" au User lsp_setup call lsp#register_server({
" \ 'name': 'rls',
" \ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']},
" \ 'workspace_config': {'rust': {'clippy_preference': 'on'}},
" \ 'whitelist': ['rust'],
" \ })
" endif
if executable('rust-analyzer')
au User lsp_setup call lsp#register_server({ au User lsp_setup call lsp#register_server({
\ 'name': 'rls', \ 'name': 'rust-analyzer',
\ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']}, \ 'cmd': {server_info->['rust-analyzer']},
\ 'workspace_config': {'rust': {'clippy_preference': 'on'}}, \ 'workspace_config': {'rust': {'clippy_preference': 'on'}},
\ 'whitelist': ['rust'], \ 'whitelist': ['rust'],
\ }) \ })