aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-14 15:29:22 +0100
committerGitHub <[email protected]>2020-05-14 15:29:22 +0100
commit12d82687cd600ec81bf3027661135e5f0d4ad4bd (patch)
tree851e7be2f0fdd6239d95e9a8f2773b4e2b51dc66 /crates/ra_db
parent87470e8f13252c12f3720a9d4235e7e5242b48dc (diff)
parente17193dc510b4a4e238db28c529289a1f4beccff (diff)
Merge #4273
4273: Trigger add_vis assist on paths/record fields as well r=flodiebold a=TimoFreiberg Resolves #4037. - [x] Function defs - [x] ADT defs - [x] Enum variants - [x] Consts - [x] Statics - [x] Traits - [x] Type aliases - [x] Modules - [x] Record fields (using different implementation) - [x] struct fields - [x] enum variant fields - :x: union fields (`Semantics::resolve_record_field` seems to not work for union fields, so I think this can be handled in a future PR) - [x] More tests? - [x] Improve test fixture code and documentation a bit (see [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/resolve_path.20between.20fixture.20files)) Co-authored-by: Timo Freiberg <[email protected]>
Diffstat (limited to 'crates/ra_db')
-rw-r--r--crates/ra_db/src/fixture.rs20
1 files changed, 17 insertions, 3 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs
index 51d4c493e..f8f767091 100644
--- a/crates/ra_db/src/fixture.rs
+++ b/crates/ra_db/src/fixture.rs
@@ -2,7 +2,7 @@
2//! A fixture without metadata is parsed into a single source file. 2//! A fixture without metadata is parsed into a single source file.
3//! Use this to test functionality local to one file. 3//! Use this to test functionality local to one file.
4//! 4//!
5//! Example: 5//! Simple Example:
6//! ``` 6//! ```
7//! r#" 7//! r#"
8//! fn main() { 8//! fn main() {
@@ -15,7 +15,7 @@
15//! The basic form is specifying filenames, 15//! The basic form is specifying filenames,
16//! which is also how to define multiple files in a single test fixture 16//! which is also how to define multiple files in a single test fixture
17//! 17//!
18//! Example: 18//! Example using two files in the same crate:
19//! ``` 19//! ```
20//! " 20//! "
21//! //- /main.rs 21//! //- /main.rs
@@ -29,6 +29,20 @@
29//! " 29//! "
30//! ``` 30//! ```
31//! 31//!
32//! Example using two crates with one file each, with one crate depending on the other:
33//! ```
34//! r#"
35//! //- /main.rs crate:a deps:b
36//! fn main() {
37//! b::foo();
38//! }
39//! //- /lib.rs crate:b
40//! pub fn b() {
41//! println!("Hello World")
42//! }
43//! "#
44//! ```
45//!
32//! Metadata allows specifying all settings and variables 46//! Metadata allows specifying all settings and variables
33//! that are available in a real rust project: 47//! that are available in a real rust project:
34//! - crate names via `crate:cratename` 48//! - crate names via `crate:cratename`
@@ -36,7 +50,7 @@
36//! - configuration settings via `cfg:dbg=false,opt_level=2` 50//! - configuration settings via `cfg:dbg=false,opt_level=2`
37//! - environment variables via `env:PATH=/bin,RUST_LOG=debug` 51//! - environment variables via `env:PATH=/bin,RUST_LOG=debug`
38//! 52//!
39//! Example: 53//! Example using all available metadata:
40//! ``` 54//! ```
41//! " 55//! "
42//! //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo 56//! //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo