@@ -53,7 +53,7 @@ xflags::xflags! {
5353
5454 /// Batch typecheck project and print summary statistics
5555 cmd analysis-stats {
56- /// Directory with Cargo.toml.
56+ /// Directory with Cargo.toml or rust-project.json .
5757 required path: PathBuf
5858
5959 optional --output format: OutputFormat
@@ -74,7 +74,7 @@ xflags::xflags! {
7474
7575 /// Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.
7676 optional --disable-build-scripts
77- /// Don't use expand proc macros.
77+ /// Don't expand proc macros.
7878 optional --disable-proc-macros
7979 /// Run the proc-macro-srv binary at the specified path.
8080 optional --proc-macro-srv path: PathBuf
@@ -101,7 +101,7 @@ xflags::xflags! {
101101
102102 /// Run unit tests of the project using mir interpreter
103103 cmd run-tests {
104- /// Directory with Cargo.toml.
104+ /// Directory with Cargo.toml or rust-project.json .
105105 required path: PathBuf
106106 }
107107
@@ -115,30 +115,45 @@ xflags::xflags! {
115115 }
116116
117117 cmd diagnostics {
118- /// Directory with Cargo.toml.
118+ /// Directory with Cargo.toml or rust-project.json .
119119 required path: PathBuf
120120
121121 /// Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.
122122 optional --disable-build-scripts
123- /// Don't use expand proc macros.
123+ /// Don't expand proc macros.
124124 optional --disable-proc-macros
125125 /// Run the proc-macro-srv binary at the specified path.
126126 optional --proc-macro-srv path: PathBuf
127127 }
128128
129129 /// Report unresolved references
130130 cmd unresolved-references {
131- /// Directory with Cargo.toml.
131+ /// Directory with Cargo.toml or rust-project.json .
132132 required path: PathBuf
133133
134134 /// Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.
135135 optional --disable-build-scripts
136- /// Don't use expand proc macros.
136+ /// Don't expand proc macros.
137137 optional --disable-proc-macros
138138 /// Run the proc-macro-srv binary at the specified path.
139139 optional --proc-macro-srv path: PathBuf
140140 }
141141
142+ /// Prime caches, as rust-analyzer does typically at startup in interactive sessions.
143+ cmd prime-caches {
144+ /// Directory with Cargo.toml or rust-project.json.
145+ required path: PathBuf
146+
147+ /// Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.
148+ optional --disable-build-scripts
149+ /// Don't expand proc macros.
150+ optional --disable-proc-macros
151+ /// Run the proc-macro-srv binary at the specified path.
152+ optional --proc-macro-srv path: PathBuf
153+ /// Run cache priming in parallel.
154+ optional --parallel
155+ }
156+
142157 cmd ssr {
143158 /// A structured search replace rule (`$a.foo($b) ==>> bar($a, $b)`)
144159 repeated rule: SsrRule
@@ -197,6 +212,7 @@ pub enum RustAnalyzerCmd {
197212 RustcTests ( RustcTests ) ,
198213 Diagnostics ( Diagnostics ) ,
199214 UnresolvedReferences ( UnresolvedReferences ) ,
215+ PrimeCaches ( PrimeCaches ) ,
200216 Ssr ( Ssr ) ,
201217 Search ( Search ) ,
202218 Lsif ( Lsif ) ,
@@ -276,6 +292,16 @@ pub struct UnresolvedReferences {
276292 pub proc_macro_srv : Option < PathBuf > ,
277293}
278294
295+ #[ derive( Debug ) ]
296+ pub struct PrimeCaches {
297+ pub path : PathBuf ,
298+
299+ pub disable_build_scripts : bool ,
300+ pub disable_proc_macros : bool ,
301+ pub proc_macro_srv : Option < PathBuf > ,
302+ pub parallel : bool ,
303+ }
304+
279305#[ derive( Debug ) ]
280306pub struct Ssr {
281307 pub rule : Vec < SsrRule > ,
0 commit comments