aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/lib.rs')
-rw-r--r--crates/ra_syntax/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index 604abe5c6..8af04c136 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -114,7 +114,7 @@ impl Parse<SyntaxNode> {
114 114
115impl Parse<SourceFile> { 115impl Parse<SourceFile> {
116 pub fn debug_dump(&self) -> String { 116 pub fn debug_dump(&self) -> String {
117 let mut buf = self.tree().syntax().debug_dump(); 117 let mut buf = format!("{:#?}", self.tree().syntax());
118 for err in self.errors.iter() { 118 for err in self.errors.iter() {
119 writeln!(buf, "error {:?}: {}", err.location(), err.kind()).unwrap(); 119 writeln!(buf, "error {:?}: {}", err.location(), err.kind()).unwrap();
120 } 120 }
@@ -234,7 +234,7 @@ fn api_walkthrough() {
234 assert_eq!(expr_syntax.kind(), SyntaxKind::BIN_EXPR); 234 assert_eq!(expr_syntax.kind(), SyntaxKind::BIN_EXPR);
235 235
236 // And text range: 236 // And text range:
237 assert_eq!(expr_syntax.range(), TextRange::from_to(32.into(), 37.into())); 237 assert_eq!(expr_syntax.text_range(), TextRange::from_to(32.into(), 37.into()));
238 238
239 // You can get node's text as a `SyntaxText` object, which will traverse the 239 // You can get node's text as a `SyntaxText` object, which will traverse the
240 // tree collecting token's text: 240 // tree collecting token's text: