mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 23:57:30 +00:00
Centralize fixture parsing for assists
This commit is contained in:
parent
44cf263edf
commit
e5101ae150
8 changed files with 65 additions and 60 deletions
|
@ -30,7 +30,9 @@ impl Fixture {
|
|||
|
||||
let mut res: Vec<Fixture> = Vec::new();
|
||||
|
||||
for (ix, line) in lines_with_ends(&fixture).enumerate() {
|
||||
let default = if ra_fixture.contains("//-") { None } else { Some("//- /main.rs") };
|
||||
|
||||
for (ix, line) in default.into_iter().chain(lines_with_ends(&fixture)).enumerate() {
|
||||
if line.contains("//-") {
|
||||
assert!(
|
||||
line.starts_with("//-"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue