mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
remove hard-coded support for ctry macro
It was used mainly to prevent HirFileId infra from bitroting, but the `vec![]` macro can serve that just as well!
This commit is contained in:
parent
9d3f4624e1
commit
de85f1e947
5 changed files with 16 additions and 73 deletions
|
@ -47,11 +47,11 @@ mod tests {
|
|||
let (analysis, frange) = single_file_with_range(
|
||||
"
|
||||
fn main() {
|
||||
ctry!(foo(|x| <|>x<|>));
|
||||
vec![foo(|x| <|>x<|>)];
|
||||
}
|
||||
",
|
||||
);
|
||||
let r = analysis.extend_selection(frange).unwrap();
|
||||
assert_eq!(r, TextRange::from_to(51.into(), 56.into()));
|
||||
assert_eq!(r, TextRange::from_to(50.into(), 55.into()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
created: "2019-01-22T14:45:01.017117100+00:00"
|
||||
creator: insta@0.4.0
|
||||
created: "2019-02-01T07:52:15.689836752+00:00"
|
||||
creator: insta@0.5.3
|
||||
expression: "&highlights"
|
||||
source: "crates\\ra_ide_api\\src\\syntax_highlighting.rs"
|
||||
source: crates/ra_ide_api/src/syntax_highlighting.rs
|
||||
---
|
||||
[
|
||||
HighlightedRange {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
created: "2019-01-22T14:45:01.043047100+00:00"
|
||||
creator: insta@0.4.0
|
||||
created: "2019-02-01T07:46:59.130146403+00:00"
|
||||
creator: insta@0.5.3
|
||||
expression: "&highlights"
|
||||
source: "crates\\ra_ide_api\\src\\syntax_highlighting.rs"
|
||||
source: crates/ra_ide_api/src/syntax_highlighting.rs
|
||||
---
|
||||
[
|
||||
HighlightedRange {
|
||||
|
@ -14,59 +14,31 @@ source: "crates\\ra_ide_api\\src\\syntax_highlighting.rs"
|
|||
tag: "function"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [41; 46),
|
||||
range: [41; 45),
|
||||
tag: "macro"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [49; 52),
|
||||
range: [48; 51),
|
||||
tag: "keyword"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [57; 59),
|
||||
range: [56; 58),
|
||||
tag: "literal"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [82; 86),
|
||||
tag: "macro"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [89; 92),
|
||||
range: [48; 51),
|
||||
tag: "keyword"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [97; 99),
|
||||
tag: "literal"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [49; 52),
|
||||
tag: "keyword"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [53; 54),
|
||||
range: [52; 53),
|
||||
tag: "function"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [57; 59),
|
||||
range: [56; 58),
|
||||
tag: "literal"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [61; 62),
|
||||
tag: "text"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [89; 92),
|
||||
tag: "keyword"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [93; 94),
|
||||
tag: "function"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [97; 99),
|
||||
tag: "literal"
|
||||
},
|
||||
HighlightedRange {
|
||||
range: [101; 102),
|
||||
range: [60; 61),
|
||||
tag: "text"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -42,7 +42,6 @@ mod tests {
|
|||
let (analysis, file_id) = single_file(
|
||||
"
|
||||
fn main() {
|
||||
ctry!({ let x = 92; x});
|
||||
vec![{ let x = 92; x}];
|
||||
}
|
||||
",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue