aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-19 12:15:55 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-19 12:15:55 +0100
commitf209843e31af7f0e0212aa28ffec2efad2a70c6f (patch)
tree548227da78a3bea644f57714d075410c0bdf7469 /crates/ra_ide_api/src/lib.rs
parent58d4983ba5745975446d60f2886d96f8d2adf0f2 (diff)
parentd4a66166c002f0a49e41d856a49cb5685ac93202 (diff)
Merge #1545
1545: migrate ra_syntax to the new rowan API r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/lib.rs')
-rw-r--r--crates/ra_ide_api/src/lib.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs
index 9f3b18d9d..c54d574bc 100644
--- a/crates/ra_ide_api/src/lib.rs
+++ b/crates/ra_ide_api/src/lib.rs
@@ -50,7 +50,7 @@ use ra_db::{
50 salsa::{self, ParallelDatabase}, 50 salsa::{self, ParallelDatabase},
51 CheckCanceled, SourceDatabase, 51 CheckCanceled, SourceDatabase,
52}; 52};
53use ra_syntax::{SourceFile, TextRange, TextUnit, TreeArc}; 53use ra_syntax::{SourceFile, TextRange, TextUnit};
54use ra_text_edit::TextEdit; 54use ra_text_edit::TextEdit;
55use relative_path::RelativePathBuf; 55use relative_path::RelativePathBuf;
56 56
@@ -325,8 +325,8 @@ impl Analysis {
325 } 325 }
326 326
327 /// Gets the syntax tree of the file. 327 /// Gets the syntax tree of the file.
328 pub fn parse(&self, file_id: FileId) -> TreeArc<SourceFile> { 328 pub fn parse(&self, file_id: FileId) -> SourceFile {
329 self.db.parse(file_id).tree().to_owned() 329 self.db.parse(file_id).tree()
330 } 330 }
331 331
332 /// Gets the file's `LineIndex`: data structure to convert between absolute 332 /// Gets the file's `LineIndex`: data structure to convert between absolute
@@ -360,7 +360,7 @@ impl Analysis {
360 let parse = self.db.parse(frange.file_id); 360 let parse = self.db.parse(frange.file_id);
361 let file_edit = SourceFileEdit { 361 let file_edit = SourceFileEdit {
362 file_id: frange.file_id, 362 file_id: frange.file_id,
363 edit: join_lines::join_lines(parse.tree(), frange.range), 363 edit: join_lines::join_lines(&parse.tree(), frange.range),
364 }; 364 };
365 SourceChange::source_file_edit("join lines", file_edit) 365 SourceChange::source_file_edit("join lines", file_edit)
366 } 366 }
@@ -393,13 +393,13 @@ impl Analysis {
393 /// file outline. 393 /// file outline.
394 pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> { 394 pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> {
395 let parse = self.db.parse(file_id); 395 let parse = self.db.parse(file_id);
396 file_structure(parse.tree()) 396 file_structure(&parse.tree())
397 } 397 }
398 398
399 /// Returns the set of folding ranges. 399 /// Returns the set of folding ranges.
400 pub fn folding_ranges(&self, file_id: FileId) -> Vec<Fold> { 400 pub fn folding_ranges(&self, file_id: FileId) -> Vec<Fold> {
401 let parse = self.db.parse(file_id); 401 let parse = self.db.parse(file_id);
402 folding_ranges::folding_ranges(parse.tree()) 402 folding_ranges::folding_ranges(&parse.tree())
403 } 403 }
404 404
405 /// Fuzzy searches for a symbol. 405 /// Fuzzy searches for a symbol.