mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Feedback.
This commit is contained in:
parent
d2d7a4403c
commit
ff87726074
3 changed files with 2 additions and 8 deletions
|
@ -150,8 +150,6 @@ impl ChangeFixture {
|
||||||
entry.text.clone()
|
entry.text.clone()
|
||||||
};
|
};
|
||||||
|
|
||||||
let explicit_root = entry.explicit_root;
|
|
||||||
|
|
||||||
let meta = FileMeta::from(entry);
|
let meta = FileMeta::from(entry);
|
||||||
assert!(meta.path.starts_with(&source_root_prefix));
|
assert!(meta.path.starts_with(&source_root_prefix));
|
||||||
|
|
||||||
|
@ -171,7 +169,7 @@ impl ChangeFixture {
|
||||||
let dep = CrateName::normalize_dashes(&dep);
|
let dep = CrateName::normalize_dashes(&dep);
|
||||||
crate_deps.push((crate_name.clone(), dep))
|
crate_deps.push((crate_name.clone(), dep))
|
||||||
}
|
}
|
||||||
} else if meta.path == "/main.rs" || meta.path == "/lib.rs" || explicit_root {
|
} else if meta.path == "/main.rs" || meta.path == "/lib.rs" {
|
||||||
assert!(default_crate_root.is_none());
|
assert!(default_crate_root.is_none());
|
||||||
default_crate_root = Some(file_id);
|
default_crate_root = Some(file_id);
|
||||||
default_cfg = meta.cfg;
|
default_cfg = meta.cfg;
|
||||||
|
|
|
@ -323,7 +323,7 @@ pub struct Baz;
|
||||||
fn module_resolution_relative_path_outside_root() {
|
fn module_resolution_relative_path_outside_root() {
|
||||||
check(
|
check(
|
||||||
r#"
|
r#"
|
||||||
//- /a/b/c/d/e/main.rs root:
|
//- /a/b/c/d/e/main.rs crate:main
|
||||||
#[path="../../../../../outside.rs"]
|
#[path="../../../../../outside.rs"]
|
||||||
mod foo;
|
mod foo;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ use stdx::{lines_with_ends, split_once, trim_indent};
|
||||||
pub struct Fixture {
|
pub struct Fixture {
|
||||||
pub path: String,
|
pub path: String,
|
||||||
pub text: String,
|
pub text: String,
|
||||||
pub explicit_root: bool,
|
|
||||||
pub krate: Option<String>,
|
pub krate: Option<String>,
|
||||||
pub deps: Vec<String>,
|
pub deps: Vec<String>,
|
||||||
pub cfg_atoms: Vec<String>,
|
pub cfg_atoms: Vec<String>,
|
||||||
|
@ -65,7 +64,6 @@ impl Fixture {
|
||||||
let path = components[0].to_string();
|
let path = components[0].to_string();
|
||||||
assert!(path.starts_with('/'));
|
assert!(path.starts_with('/'));
|
||||||
|
|
||||||
let mut explicit_root = false;
|
|
||||||
let mut krate = None;
|
let mut krate = None;
|
||||||
let mut deps = Vec::new();
|
let mut deps = Vec::new();
|
||||||
let mut edition = None;
|
let mut edition = None;
|
||||||
|
@ -75,7 +73,6 @@ impl Fixture {
|
||||||
for component in components[1..].iter() {
|
for component in components[1..].iter() {
|
||||||
let (key, value) = split_once(component, ':').unwrap();
|
let (key, value) = split_once(component, ':').unwrap();
|
||||||
match key {
|
match key {
|
||||||
"root" => explicit_root = true,
|
|
||||||
"crate" => krate = Some(value.to_string()),
|
"crate" => krate = Some(value.to_string()),
|
||||||
"deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
|
"deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
|
||||||
"edition" => edition = Some(value.to_string()),
|
"edition" => edition = Some(value.to_string()),
|
||||||
|
@ -101,7 +98,6 @@ impl Fixture {
|
||||||
Fixture {
|
Fixture {
|
||||||
path,
|
path,
|
||||||
text: String::new(),
|
text: String::new(),
|
||||||
explicit_root: explicit_root,
|
|
||||||
krate: krate,
|
krate: krate,
|
||||||
deps,
|
deps,
|
||||||
cfg_atoms,
|
cfg_atoms,
|
||||||
|
|
Loading…
Reference in a new issue