aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_syntax/src/parsing/reparsing.rs8
-rw-r--r--crates/ra_syntax/src/syntax_kinds.rs3
-rw-r--r--crates/tools/src/lib.rs2
3 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs
index a88f53dae..edf3fa291 100644
--- a/crates/ra_syntax/src/parsing/reparsing.rs
+++ b/crates/ra_syntax/src/parsing/reparsing.rs
@@ -79,10 +79,12 @@ fn is_contextual_kw(text: &str) -> bool {
79 } 79 }
80} 80}
81 81
82type ParseFn = fn(&mut Parser); 82fn find_reparsable_node(
83fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(&SyntaxNode, ParseFn)> { 83 node: &SyntaxNode,
84 range: TextRange,
85) -> Option<(&SyntaxNode, fn(&mut Parser))> {
84 let node = algo::find_covering_node(node, range); 86 let node = algo::find_covering_node(node, range);
85 node.ancestors().find_map(grammar::reparser).map(|r| (node, r)) 87 node.ancestors().find_map(|node| grammar::reparser(node).map(|r| (node, r)))
86} 88}
87 89
88fn is_balanced(tokens: &[Token]) -> bool { 90fn is_balanced(tokens: &[Token]) -> bool {
diff --git a/crates/ra_syntax/src/syntax_kinds.rs b/crates/ra_syntax/src/syntax_kinds.rs
index d53886676..c1118c5ab 100644
--- a/crates/ra_syntax/src/syntax_kinds.rs
+++ b/crates/ra_syntax/src/syntax_kinds.rs
@@ -1,8 +1,9 @@
1mod generated; 1mod generated;
2 2
3use crate::SyntaxKind::*;
4use std::fmt; 3use std::fmt;
5 4
5use crate::SyntaxKind::*;
6
6pub use self::generated::SyntaxKind; 7pub use self::generated::SyntaxKind;
7 8
8impl fmt::Debug for SyntaxKind { 9impl fmt::Debug for SyntaxKind {
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs
index ef9c613a7..0a10d2737 100644
--- a/crates/tools/src/lib.rs
+++ b/crates/tools/src/lib.rs
@@ -14,7 +14,7 @@ pub use teraron::{Mode, Overwrite, Verify};
14pub type Result<T> = std::result::Result<T, failure::Error>; 14pub type Result<T> = std::result::Result<T, failure::Error>;
15 15
16pub const GRAMMAR: &str = "crates/ra_syntax/src/grammar.ron"; 16pub const GRAMMAR: &str = "crates/ra_syntax/src/grammar.ron";
17const GRAMMAR_DIR: &str = "crates/ra_syntax/src/grammar"; 17const GRAMMAR_DIR: &str = "crates/ra_syntax/src/parsing/grammar";
18const OK_INLINE_TESTS_DIR: &str = "crates/ra_syntax/tests/data/parser/inline/ok"; 18const OK_INLINE_TESTS_DIR: &str = "crates/ra_syntax/tests/data/parser/inline/ok";
19const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/tests/data/parser/inline/err"; 19const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/tests/data/parser/inline/err";
20 20