@@ -273,9 +273,6 @@ However, if you use some other build system, you'll have to describe the structu
273
273
[source,TypeScript]
274
274
----
275
275
interface JsonProject {
276
- /// The set of paths containing the crates for this project.
277
- /// Any `Crate` must be nested inside some `root`.
278
- roots: string[];
279
276
/// The set of crates comprising the current project.
280
277
/// Must include all transitive dependencies as well as sysroot crate (libstd, libcore and such).
281
278
crates: Crate[];
@@ -288,11 +285,37 @@ interface Crate {
288
285
edition: "2015" | "2018";
289
286
/// Dependencies
290
287
deps: Dep[];
288
+ /// Should this crate be treated as a member of current "workspace".
289
+ ///
290
+ /// By default, inferred from the `root_module` (members are the crates which reside
291
+ /// inside the directory opened in the editor).
292
+ ///
293
+ /// Set this too `false` for things like standard library and 3rd party crates to
294
+ /// enable performance optimizations (rust-analyzer assumes that non-member crates
295
+ /// don't change).
296
+ is_workspace_member?: boolean;
297
+ /// Optionally specify the (super)set of `.rs` files comprising this crate.
298
+ ///
299
+ /// By default, rust-analyzer assumes that only files under `root_module.parent` can belong to a crate.
300
+ /// `include_dirs` are included recursively, unless a subdirectory is in `exclude_dirs`.
301
+ ///
302
+ /// Different crates can share the same `source`.
303
+
304
+ /// If two crates share an `.rs` file in common, they *must* have the same `source`.
305
+ /// rust-analyzer assumes that files from one source can't refer to files in another source.
306
+ source?: {
307
+ include_dirs: string[],
308
+ exclude_dirs: string[],
309
+ },
291
310
/// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`.
292
311
cfg: string[];
312
+ /// Target tripple for this Crate.
313
+ ///
314
+ /// It is use when running `rustc --print cfg` to get target-specific cfgs.
315
+ target?: string;
316
+ /// Environment variables, used for `env!` macro
317
+ env: : { [key: string]: string; },
293
318
294
- /// value of the OUT_DIR env variable.
295
- out_dir?: string;
296
319
/// For proc-macro crates, path to compiles proc-macro (.so file).
297
320
proc_macro_dylib_path?: string;
298
321
}
0 commit comments