mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Adjust incorrect runnable tests
This commit is contained in:
parent
e09d410dcd
commit
f781e599cc
2 changed files with 3 additions and 5 deletions
|
@ -298,7 +298,6 @@ impl TryToNav for hir::Impl {
|
||||||
let InFile { file_id, value } = self.source(db)?;
|
let InFile { file_id, value } = self.source(db)?;
|
||||||
let derive_attr = self.is_builtin_derive(db);
|
let derive_attr = self.is_builtin_derive(db);
|
||||||
|
|
||||||
let range = |syntax: &_| InFile::new(file_id, syntax).original_file_range(db);
|
|
||||||
let focus_range = if derive_attr.is_some() {
|
let focus_range = if derive_attr.is_some() {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
@ -307,9 +306,10 @@ impl TryToNav for hir::Impl {
|
||||||
.and_then(|ty| InFile::new(file_id, ty.syntax()).original_file_range_opt(db))
|
.and_then(|ty| InFile::new(file_id, ty.syntax()).original_file_range_opt(db))
|
||||||
.map(|it| it.range)
|
.map(|it| it.range)
|
||||||
};
|
};
|
||||||
|
|
||||||
let FileRange { file_id, range: full_range } = match &derive_attr {
|
let FileRange { file_id, range: full_range } = match &derive_attr {
|
||||||
Some(InFile { value, .. }) => range(value.syntax()),
|
Some(attr) => attr.syntax().original_file_range(db),
|
||||||
None => range(value.syntax()),
|
None => InFile::new(file_id, value.syntax()).original_file_range(db),
|
||||||
};
|
};
|
||||||
|
|
||||||
Some(NavigationTarget::from_syntax(
|
Some(NavigationTarget::from_syntax(
|
||||||
|
|
|
@ -1437,7 +1437,6 @@ gen2!();
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
full_range: 228..236,
|
full_range: 228..236,
|
||||||
focus_range: 228..236,
|
|
||||||
name: "tests2",
|
name: "tests2",
|
||||||
kind: Module,
|
kind: Module,
|
||||||
description: "mod tests2",
|
description: "mod tests2",
|
||||||
|
@ -1522,7 +1521,6 @@ foo!();
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
full_range: 210..217,
|
full_range: 210..217,
|
||||||
focus_range: 210..217,
|
|
||||||
name: "foo_tests",
|
name: "foo_tests",
|
||||||
kind: Module,
|
kind: Module,
|
||||||
description: "mod foo_tests",
|
description: "mod foo_tests",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue