mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
migrate ra_syntax to the new rowan API
This commit is contained in:
parent
58d4983ba5
commit
d402974aa0
20 changed files with 1189 additions and 2352 deletions
|
@ -5,7 +5,7 @@ use crate::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
pub(crate) fn validate_block_node(node: &ast::Block, errors: &mut Vec<SyntaxError>) {
|
||||
pub(crate) fn validate_block_node(node: ast::Block, errors: &mut Vec<SyntaxError>) {
|
||||
if let Some(parent) = node.syntax().parent() {
|
||||
match parent.kind() {
|
||||
FN_DEF => return,
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
|||
SyntaxErrorKind::*,
|
||||
};
|
||||
|
||||
pub(crate) fn validate_field_expr_node(node: &ast::FieldExpr, errors: &mut Vec<SyntaxError>) {
|
||||
pub(crate) fn validate_field_expr_node(node: ast::FieldExpr, errors: &mut Vec<SyntaxError>) {
|
||||
if let Some(FieldKind::Index(idx)) = node.field_access() {
|
||||
if idx.text().chars().any(|c| c < '0' || c > '9') {
|
||||
errors.push(SyntaxError::new(InvalidTupleIndexFormat, idx.range()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue