Skip to content

Commit

Permalink
Merge pull request #56 from guni1192/nvim-rust-env
Browse files Browse the repository at this point in the history
update rust-analyzer configuration
  • Loading branch information
guni1192 authored Oct 22, 2023
2 parents b7c1cd1 + 872d8f8 commit f2e73aa
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions nvim/lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,24 @@ if executable('gopls')
endif

if executable('rust-analyzer')
au User lsp_setup call lsp#register_server({
\ 'name': 'rust-analyzer',
\ 'cmd': {server_info->['rustup', 'run', 'stable', 'rust-analyzer']},
\ 'whitelist': ['rust'],
au User lsp_setup call lsp#register_server({
\ 'name': 'Rust Language Server',
\ 'cmd': {server_info->['rust-analyzer']},
\ 'whitelist': ['rust'],
\ 'initialization_options': {
\ 'cargo': {
\ 'buildScripts': {
\ 'enable': v:true,
\ },
\ },
\ 'procMacro': {
\ 'enable': v:true,
\ },
\ },
\ })
autocmd BufWritePre *.rs LspDocumentFormatSync
endif


if executable('clangd')
au User lsp_setup call lsp#register_server({
\ 'name': 'clangd',
Expand Down

0 comments on commit f2e73aa

Please sign in to comment.