mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-07 19:10:53 +00:00
fix suffix ranges
This commit is contained in:
parent
a912b261d3
commit
49b0fe20ab
6 changed files with 95 additions and 4 deletions
|
@ -28,7 +28,10 @@ pub(super) fn validate_byte_node(node: ast::Byte, errors: &mut Vec<SyntaxError>)
|
|||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
errors.push(SyntaxError::new(
|
||||
InvalidSuffix,
|
||||
range + literal_range.start(),
|
||||
));
|
||||
}
|
||||
|
||||
if len == 0 {
|
||||
|
|
|
@ -34,7 +34,10 @@ pub(crate) fn validate_byte_string_node(node: ast::ByteString, errors: &mut Vec<
|
|||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
errors.push(SyntaxError::new(
|
||||
InvalidSuffix,
|
||||
range + literal_range.start(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,10 @@ pub(super) fn validate_char_node(node: ast::Char, errors: &mut Vec<SyntaxError>)
|
|||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
errors.push(SyntaxError::new(
|
||||
InvalidSuffix,
|
||||
range + literal_range.start(),
|
||||
));
|
||||
}
|
||||
|
||||
if len == 0 {
|
||||
|
|
|
@ -29,7 +29,10 @@ pub(crate) fn validate_string_node(node: ast::String, errors: &mut Vec<SyntaxErr
|
|||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
errors.push(SyntaxError::new(
|
||||
InvalidSuffix,
|
||||
range + literal_range.start(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue