aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-05 12:47:59 +0000
committerAleksey Kladov <[email protected]>2018-11-05 12:47:59 +0000
commit80e50cae0066b2c662607841fa20dd84f024ad4e (patch)
treeade4b933b10b5693fa6a50e2e49204cb8ee1b560
parent420725f25626948ea57fdc9192e9cb30fd5a266a (diff)
Switch ra_syntax to 2015 edition
-rw-r--r--crates/ra_syntax/Cargo.toml2
-rw-r--r--crates/ra_syntax/src/lib.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml
index 043c9bacd..6c2e012ee 100644
--- a/crates/ra_syntax/Cargo.toml
+++ b/crates/ra_syntax/Cargo.toml
@@ -1,5 +1,5 @@
1[package] 1[package]
2edition = "2018" 2edition = "2015"
3name = "ra_syntax" 3name = "ra_syntax"
4version = "0.1.0" 4version = "0.1.0"
5authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index 8996eb921..acc2d9603 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -60,6 +60,7 @@ pub use crate::{
60 60
61use crate::yellow::GreenNode; 61use crate::yellow::GreenNode;
62 62
63/// File represents a parse tree for a single Rust file.
63#[derive(Clone, Debug, Hash, PartialEq, Eq)] 64#[derive(Clone, Debug, Hash, PartialEq, Eq)]
64pub struct File { 65pub struct File {
65 root: SyntaxNode, 66 root: SyntaxNode,
@@ -92,9 +93,11 @@ impl File {
92 text_utils::replace_range(self.syntax().text().to_string(), edit.delete, &edit.insert); 93 text_utils::replace_range(self.syntax().text().to_string(), edit.delete, &edit.insert);
93 File::parse(&text) 94 File::parse(&text)
94 } 95 }
96 /// Typed AST representation of the parse tree.
95 pub fn ast(&self) -> ast::Root { 97 pub fn ast(&self) -> ast::Root {
96 ast::Root::cast(self.syntax()).unwrap() 98 ast::Root::cast(self.syntax()).unwrap()
97 } 99 }
100 /// Untyped homogeneous representation of the parse tree.
98 pub fn syntax(&self) -> SyntaxNodeRef { 101 pub fn syntax(&self) -> SyntaxNodeRef {
99 self.root.borrowed() 102 self.root.borrowed()
100 } 103 }