Skip to content

Commit 31800c6

Browse files
committed
Disable cargo check on save
Otherwise if we want to build manually in a different terminal after saving, we will get an annoying conflict, where our build is blocked by the editor build until it is finished: "Blocking waiting for file lock on build directory" rust-analyzer can still autocomplete just fine if we disable checkOnSave, we will just miss out on the cargo check warnings. ref: rust-lang/rust-analyzer#4616
1 parent 214791d commit 31800c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vim/.vimrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ let g:ale_virtualtext_cursor = 1
219219
let g:ale_virtualtext_prefix = "🔧 "
220220
let g:ale_floating_preview = 1
221221
let g:ale_floating_window_border = []
222-
let g:ale_linters = #{python: []}
222+
let g:ale_linters = #{python: [], rust: []}
223223

224224
"fugitive
225225
nnoremap <silent> <LocalLeader>Gb :0,3Git blame<CR>
@@ -284,7 +284,7 @@ au VimEnter * call LspAddServer([
284284
\ #{ name: 'nix', filetype: ['nix'], path: 'nil' },
285285
\ #{ name: 'python', filetype: ['python'], path: 'pylsp' },
286286
\ #{ name: 'qml', filetype: ['qml'], path: 'qmlls6' },
287-
\ #{ name: 'rust', filetype: ['rust'], path: 'rust-analyzer', syncInit: 1 },
287+
\ #{ name: 'rust', filetype: ['rust'], path: 'rust-analyzer', syncInit: 1, initializationOptions: #{ checkOnSave: v:false } },
288288
\ ])
289289
nmap <LocalLeader>qf <Cmd>LspCodeAction<CR>
290290
nmap gd <Cmd>LspGotoDefinition<CR>

0 commit comments

Comments
 (0)