aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/syntax_error.rs
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-01-24 01:39:23 +0000
committerVeetaha <[email protected]>2020-02-03 22:00:55 +0000
commitad24976da38482948c586bdbc16004273662ff7e (patch)
tree9a54ae3eb36b123c82634b557df21e0d47848834 /crates/ra_syntax/src/syntax_error.rs
parentb090ee5a65f9630146c2842bc51fcfcc8da08da1 (diff)
ra_syntax: changed added diagnostics information returned from tokenize() (implemented with iterators)
Diffstat (limited to 'crates/ra_syntax/src/syntax_error.rs')
-rw-r--r--crates/ra_syntax/src/syntax_error.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/syntax_error.rs b/crates/ra_syntax/src/syntax_error.rs
index 6c171df8d..9122dda29 100644
--- a/crates/ra_syntax/src/syntax_error.rs
+++ b/crates/ra_syntax/src/syntax_error.rs
@@ -4,7 +4,7 @@ use std::fmt;
4 4
5use ra_parser::ParseError; 5use ra_parser::ParseError;
6 6
7use crate::{validation::EscapeError, TextRange, TextUnit}; 7use crate::{validation::EscapeError, TextRange, TextUnit, TokenizeError};
8 8
9#[derive(Debug, Clone, PartialEq, Eq, Hash)] 9#[derive(Debug, Clone, PartialEq, Eq, Hash)]
10pub struct SyntaxError { 10pub struct SyntaxError {
@@ -12,6 +12,10 @@ pub struct SyntaxError {
12 location: Location, 12 location: Location,
13} 13}
14 14
15// FIXME: Location should be just `Location(TextRange)`
16// TextUnit enum member just unnecessarily compicates things,
17// we should'n treat it specially, it just as a `TextRange { start: x, end: x + 1 }`
18// see `location_to_range()` in ra_ide/src/diagnostics
15#[derive(Clone, PartialEq, Eq, Hash)] 19#[derive(Clone, PartialEq, Eq, Hash)]
16pub enum Location { 20pub enum Location {
17 Offset(TextUnit), 21 Offset(TextUnit),
@@ -79,6 +83,7 @@ impl fmt::Display for SyntaxError {
79pub enum SyntaxErrorKind { 83pub enum SyntaxErrorKind {
80 ParseError(ParseError), 84 ParseError(ParseError),
81 EscapeError(EscapeError), 85 EscapeError(EscapeError),
86 TokenizeError(TokenizeError),
82 InvalidBlockAttr, 87 InvalidBlockAttr,
83 InvalidMatchInnerAttr, 88 InvalidMatchInnerAttr,
84 InvalidTupleIndexFormat, 89 InvalidTupleIndexFormat,