diff options
author | Aleksey Kladov <[email protected]> | 2020-07-21 14:43:56 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-21 14:43:56 +0100 |
commit | ca2a4ccf0578e1bc3ed06f0a7d34708478a8acae (patch) | |
tree | 9aeee001880a61a424598372b231ccb804b53add /docs | |
parent | b48336bf940ce1b55e72d244ff9f28573f2e5548 (diff) |
Document new rust-project.json format
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/manual.adoc | 33 |
1 files changed, 28 insertions, 5 deletions
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 | |||
273 | [source,TypeScript] | 273 | [source,TypeScript] |
274 | ---- | 274 | ---- |
275 | interface JsonProject { | 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 | /// The set of crates comprising the current project. | 276 | /// The set of crates comprising the current project. |
280 | /// Must include all transitive dependencies as well as sysroot crate (libstd, libcore and such). | 277 | /// Must include all transitive dependencies as well as sysroot crate (libstd, libcore and such). |
281 | crates: Crate[]; | 278 | crates: Crate[]; |
@@ -288,11 +285,37 @@ interface Crate { | |||
288 | edition: "2015" | "2018"; | 285 | edition: "2015" | "2018"; |
289 | /// Dependencies | 286 | /// Dependencies |
290 | deps: Dep[]; | 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 | /// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`. | 310 | /// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`. |
292 | cfg: string[]; | 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 | /// For proc-macro crates, path to compiles proc-macro (.so file). | 319 | /// For proc-macro crates, path to compiles proc-macro (.so file). |
297 | proc_macro_dylib_path?: string; | 320 | proc_macro_dylib_path?: string; |
298 | } | 321 | } |