File tree 2 files changed +33
-3
lines changed
2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,31 @@ g:rust_shortener_url~
133
133
let g:rust_shortener_url = 'https://is.gd/'
134
134
<
135
135
136
+ *g:rustc_syntax_only*
137
+ g:rustc_syntax_only~
138
+ Set this option to control the syntastic linter.
139
+ You can choose between a simple syntax parser or a fuller compilation.
140
+
141
+ The syntax parser is very fast, but won't catch any compilation
142
+ errors. This is the default.
143
+ We recommend you enable syntastic's active mode with this setting
144
+ (that's the default too). >
145
+ let g:rustc_syntax_only = 1
146
+ <
147
+
148
+ The fuller compilation performs a compilation of the entire project.
149
+ This makes it really slow on large projects.
150
+ If VIM becomes unusable, set syntastic passive mode for Rust. This
151
+ will make it so that the lint will only run on | :SyntasticCheck | (see
152
+ | syntastic_mode_map | ).
153
+ >
154
+ let g:rustc_syntax_only = 0
155
+ " Syntastic passive mode
156
+ let g:syntastic_mode_map = {
157
+ \ "mode": "active",
158
+ \ "active_filetypes": [],
159
+ \ "passive_filetypes": ["rust"] }
160
+ <
136
161
137
162
==============================================================================
138
163
COMMANDS *rust-commands*
Original file line number Diff line number Diff line change @@ -10,23 +10,28 @@ if exists("g:loaded_syntastic_rust_rustc_checker")
10
10
endif
11
11
let g: loaded_syntastic_rust_rustc_checker = 1
12
12
13
+ if ! exists (' g:rustc_syntax_only' )
14
+ let g: rustc_syntax_only = 1 " Keep the fast behaviour by default
15
+ endif
16
+
13
17
let s: save_cpo = &cpo
14
18
set cpo &vim
15
19
16
20
function ! SyntaxCheckers_rust_rustc_GetLocList () dict
21
+ let compiler_params = g: rustc_syntax_only ? ' -Zparse-only' : ' -Zno-trans'
17
22
let cwd = ' .' " Don't change cwd as default
18
23
let cargo_toml_path = findfile (' Cargo.toml' , ' .;' )
19
24
if empty (cargo_toml_path) " Plain rs file, not a crate
20
25
let makeprg = self .makeprgBuild ({
21
26
\ ' exe' : ' rustc' ,
22
- \ ' args' : ' -Zno-trans ' })
27
+ \ ' args' : compiler_params })
23
28
else " We are inside a crate
24
29
let makeprg = self .makeprgBuild ({
25
30
\ ' exe' : ' cargo' ,
26
- \ ' args' : ' rustc -Zno-trans ' ,
31
+ \ ' args' : ' rustc ' . compiler_params ,
27
32
\ ' fname' : ' ' })
28
33
" Change cwd to the root of the crate
29
- let cwd = fnamemodify ( cargo_toml_path, ' :p:h' )
34
+ let cwd = fnamemodify ( cargo_toml_path, ' :p:h' )
30
35
endif
31
36
32
37
let errorformat =
You can’t perform that action at this time.
0 commit comments