aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/validation
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
committerAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
commitf3bdbec1b68fa0e20f0b7b6c6ef64e1507970b0d (patch)
treef2cb82f74d2d60d5351c3d7c4d8e7bce4d351cab /crates/ra_syntax/src/validation
parent6d5d82e412dea19ea48eecc6f7d5a4aa223a9599 (diff)
rename range -> text_range
Diffstat (limited to 'crates/ra_syntax/src/validation')
-rw-r--r--crates/ra_syntax/src/validation/block.rs5
-rw-r--r--crates/ra_syntax/src/validation/field_expr.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/validation/block.rs b/crates/ra_syntax/src/validation/block.rs
index f5573bd8f..c5588658d 100644
--- a/crates/ra_syntax/src/validation/block.rs
+++ b/crates/ra_syntax/src/validation/block.rs
@@ -16,6 +16,7 @@ pub(crate) fn validate_block_node(node: ast::Block, errors: &mut Vec<SyntaxError
16 _ => {} 16 _ => {}
17 } 17 }
18 } 18 }
19 errors 19 errors.extend(
20 .extend(node.attrs().map(|attr| SyntaxError::new(InvalidBlockAttr, attr.syntax().range()))) 20 node.attrs().map(|attr| SyntaxError::new(InvalidBlockAttr, attr.syntax().text_range())),
21 )
21} 22}
diff --git a/crates/ra_syntax/src/validation/field_expr.rs b/crates/ra_syntax/src/validation/field_expr.rs
index 0e18bd9ca..004f199fd 100644
--- a/crates/ra_syntax/src/validation/field_expr.rs
+++ b/crates/ra_syntax/src/validation/field_expr.rs
@@ -7,7 +7,7 @@ use crate::{
7pub(crate) fn validate_field_expr_node(node: ast::FieldExpr, errors: &mut Vec<SyntaxError>) { 7pub(crate) fn validate_field_expr_node(node: ast::FieldExpr, errors: &mut Vec<SyntaxError>) {
8 if let Some(FieldKind::Index(idx)) = node.field_access() { 8 if let Some(FieldKind::Index(idx)) = node.field_access() {
9 if idx.text().chars().any(|c| c < '0' || c > '9') { 9 if idx.text().chars().any(|c| c < '0' || c > '9') {
10 errors.push(SyntaxError::new(InvalidTupleIndexFormat, idx.range())); 10 errors.push(SyntaxError::new(InvalidTupleIndexFormat, idx.text_range()));
11 } 11 }
12 } 12 }
13} 13}