Skip to content

Commit ca2a4cc

Browse files
committed
Document new rust-project.json format
1 parent b48336b commit ca2a4cc

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

docs/user/manual.adoc

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,6 @@ However, if you use some other build system, you'll have to describe the structu
273273
[source,TypeScript]
274274
----
275275
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[];
279276
/// The set of crates comprising the current project.
280277
/// Must include all transitive dependencies as well as sysroot crate (libstd, libcore and such).
281278
crates: Crate[];
@@ -288,11 +285,37 @@ interface Crate {
288285
edition: "2015" | "2018";
289286
/// Dependencies
290287
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+
},
291310
/// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`.
292311
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; },
293318
294-
/// value of the OUT_DIR env variable.
295-
out_dir?: string;
296319
/// For proc-macro crates, path to compiles proc-macro (.so file).
297320
proc_macro_dylib_path?: string;
298321
}

0 commit comments

Comments
 (0)