From ca2a4ccf0578e1bc3ed06f0a7d34708478a8acae Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 21 Jul 2020 15:43:56 +0200 Subject: Document new rust-project.json format --- docs/user/manual.adoc | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'docs/user') diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 978b463d5..8e95f51e3 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc @@ -273,9 +273,6 @@ However, if you use some other build system, you'll have to describe the structu [source,TypeScript] ---- interface JsonProject { - /// The set of paths containing the crates for this project. - /// Any `Crate` must be nested inside some `root`. - roots: string[]; /// The set of crates comprising the current project. /// Must include all transitive dependencies as well as sysroot crate (libstd, libcore and such). crates: Crate[]; @@ -288,11 +285,37 @@ interface Crate { edition: "2015" | "2018"; /// Dependencies deps: Dep[]; + /// Should this crate be treated as a member of current "workspace". + /// + /// By default, inferred from the `root_module` (members are the crates which reside + /// inside the directory opened in the editor). + /// + /// Set this too `false` for things like standard library and 3rd party crates to + /// enable performance optimizations (rust-analyzer assumes that non-member crates + /// don't change). + is_workspace_member?: boolean; + /// Optionally specify the (super)set of `.rs` files comprising this crate. + /// + /// By default, rust-analyzer assumes that only files under `root_module.parent` can belong to a crate. + /// `include_dirs` are included recursively, unless a subdirectory is in `exclude_dirs`. + /// + /// Different crates can share the same `source`. + + /// If two crates share an `.rs` file in common, they *must* have the same `source`. + /// rust-analyzer assumes that files from one source can't refer to files in another source. + source?: { + include_dirs: string[], + exclude_dirs: string[], + }, /// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`. cfg: string[]; + /// Target tripple for this Crate. + /// + /// It is use when running `rustc --print cfg` to get target-specific cfgs. + target?: string; + /// Environment variables, used for `env!` macro + env: : { [key: string]: string; }, - /// value of the OUT_DIR env variable. - out_dir?: string; /// For proc-macro crates, path to compiles proc-macro (.so file). proc_macro_dylib_path?: string; } -- cgit v1.2.3 From eb613c74da3b82529ed269817b388a3a37dff1fc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 21 Jul 2020 17:09:56 +0200 Subject: Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laurențiu Nicola --- docs/user/manual.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/user') diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 8e95f51e3..2a58cd85f 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc @@ -290,7 +290,7 @@ interface Crate { /// By default, inferred from the `root_module` (members are the crates which reside /// inside the directory opened in the editor). /// - /// Set this too `false` for things like standard library and 3rd party crates to + /// Set this to `false` for things like standard library and 3rd party crates to /// enable performance optimizations (rust-analyzer assumes that non-member crates /// don't change). is_workspace_member?: boolean; @@ -309,11 +309,11 @@ interface Crate { }, /// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`. cfg: string[]; - /// Target tripple for this Crate. + /// Target triple for this Crate. /// - /// It is use when running `rustc --print cfg` to get target-specific cfgs. + /// Used when running `rustc --print cfg` to get target-specific cfgs. target?: string; - /// Environment variables, used for `env!` macro + /// Environment variables, used for the `env!` macro env: : { [key: string]: string; }, /// For proc-macro crates, path to compiles proc-macro (.so file). -- cgit v1.2.3