[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 = {
\ 'javascript': ['standard'],
\ 'go': ['gopls'],
\ 'rust': ['analyzer'],
\}
let g:ale_fixers = {'javascript': ['standard']}
let g:ale_lint_on_save = 1
@ -278,10 +279,18 @@ endif
" rustup update
" 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({
\ 'name': 'rls',
\ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']},
\ 'name': 'rust-analyzer',
\ 'cmd': {server_info->['rust-analyzer']},
\ 'workspace_config': {'rust': {'clippy_preference': 'on'}},
\ 'whitelist': ['rust'],
\ })