mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
rename range -> text_range
This commit is contained in:
parent
6d5d82e412
commit
f3bdbec1b6
54 changed files with 219 additions and 192 deletions
|
@ -33,7 +33,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
|
|||
if let Some(end) = text.rfind('\'') {
|
||||
if let Some(without_quotes) = text.get(2..end) {
|
||||
if let Err((off, err)) = unescape::unescape_byte(without_quotes) {
|
||||
let off = token.range().start() + TextUnit::from_usize(off + 2);
|
||||
let off = token.text_range().start() + TextUnit::from_usize(off + 2);
|
||||
acc.push(SyntaxError::new(err.into(), off))
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
|
|||
if let Some(end) = text.rfind('\'') {
|
||||
if let Some(without_quotes) = text.get(1..end) {
|
||||
if let Err((off, err)) = unescape::unescape_char(without_quotes) {
|
||||
let off = token.range().start() + TextUnit::from_usize(off + 1);
|
||||
let off = token.text_range().start() + TextUnit::from_usize(off + 1);
|
||||
acc.push(SyntaxError::new(err.into(), off))
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
|
|||
unescape::unescape_byte_str(without_quotes, &mut |range, char| {
|
||||
if let Err(err) = char {
|
||||
let off = range.start;
|
||||
let off = token.range().start() + TextUnit::from_usize(off + 2);
|
||||
let off = token.text_range().start() + TextUnit::from_usize(off + 2);
|
||||
acc.push(SyntaxError::new(err.into(), off))
|
||||
}
|
||||
})
|
||||
|
@ -68,7 +68,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
|
|||
unescape::unescape_str(without_quotes, &mut |range, char| {
|
||||
if let Err(err) = char {
|
||||
let off = range.start;
|
||||
let off = token.range().start() + TextUnit::from_usize(off + 1);
|
||||
let off = token.text_range().start() + TextUnit::from_usize(off + 1);
|
||||
acc.push(SyntaxError::new(err.into(), off))
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue