mirror of
https://github.com/amix/vimrc
synced 2025-08-02 19:15:00 +08:00
Update Ale.
This commit is contained in:
@ -9,9 +9,21 @@ function! ale_linters#rust#analyzer#GetCommand(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#rust#analyzer#GetProjectRoot(buffer) abort
|
||||
" Try to find nearest Cargo.toml for cargo projects
|
||||
let l:cargo_file = ale#path#FindNearestFile(a:buffer, 'Cargo.toml')
|
||||
|
||||
return !empty(l:cargo_file) ? fnamemodify(l:cargo_file, ':h') : ''
|
||||
if !empty(l:cargo_file)
|
||||
return fnamemodify(l:cargo_file, ':h')
|
||||
endif
|
||||
|
||||
" Try to find nearest rust-project.json for non-cargo projects
|
||||
let l:rust_project = ale#path#FindNearestFile(a:buffer, 'rust-project.json')
|
||||
|
||||
if !empty(l:rust_project)
|
||||
return fnamemodify(l:rust_project, ':h')
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('rust', {
|
||||
|
5
sources_non_forked/ale/ale_linters/rust/cspell.vim
Normal file
5
sources_non_forked/ale/ale_linters/rust/cspell.vim
Normal file
@ -0,0 +1,5 @@
|
||||
scriptencoding utf-8
|
||||
" Author: David Houston <houstdav000>
|
||||
" Description: cspell support for Rust files.
|
||||
|
||||
call ale#handlers#cspell#DefineLinter('rust')
|
@ -1,7 +1,7 @@
|
||||
" Author: Daniel Schemala <istjanichtzufassen@gmail.com>
|
||||
" Description: rustc for rust files
|
||||
|
||||
call ale#Set('rust_rustc_options', '-Z no-codegen')
|
||||
call ale#Set('rust_rustc_options', '--emit=mir -o /dev/null')
|
||||
|
||||
function! ale_linters#rust#rustc#RustcCommand(buffer) abort
|
||||
" Try to guess the library search path. If the project is managed by cargo,
|
||||
|
Reference in New Issue
Block a user