aboutsummaryrefslogtreecommitdiff
path: root/crates/libanalysis/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-25 09:44:58 +0100
committerAleksey Kladov <[email protected]>2018-08-25 09:44:58 +0100
commit220d285b4afb250e59a08e9b1ad38c2fc2275782 (patch)
treeab32fc8d58ee04fc5afae20bc80f02c6b2557a39 /crates/libanalysis/src
parentcf278ed3bf71d336422f7d7d7d51be92b717b720 (diff)
rename ParsedFile -> File
Diffstat (limited to 'crates/libanalysis/src')
-rw-r--r--crates/libanalysis/src/lib.rs14
-rw-r--r--crates/libanalysis/src/module_map.rs4
-rw-r--r--crates/libanalysis/src/symbol_index.rs4
3 files changed, 11 insertions, 11 deletions
diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs
index a0f17a689..c84ab6077 100644
--- a/crates/libanalysis/src/lib.rs
+++ b/crates/libanalysis/src/lib.rs
@@ -27,7 +27,7 @@ use std::{
27}; 27};
28 28
29use libsyntax2::{ 29use libsyntax2::{
30 ParsedFile, 30 File,
31 TextUnit, TextRange, SmolStr, 31 TextUnit, TextRange, SmolStr,
32 ast::{self, AstNode, NameOwner}, 32 ast::{self, AstNode, NameOwner},
33 SyntaxKind::*, 33 SyntaxKind::*,
@@ -132,7 +132,7 @@ impl WorldState {
132 132
133 133
134impl World { 134impl World {
135 pub fn file_syntax(&self, file_id: FileId) -> Result<ParsedFile> { 135 pub fn file_syntax(&self, file_id: FileId) -> Result<File> {
136 let data = self.file_data(file_id)?; 136 let data = self.file_data(file_id)?;
137 Ok(data.syntax().clone()) 137 Ok(data.syntax().clone())
138 } 138 }
@@ -265,7 +265,7 @@ struct WorldData {
265struct FileData { 265struct FileData {
266 text: String, 266 text: String,
267 symbols: OnceCell<FileSymbols>, 267 symbols: OnceCell<FileSymbols>,
268 syntax: OnceCell<ParsedFile>, 268 syntax: OnceCell<File>,
269 lines: OnceCell<LineIndex>, 269 lines: OnceCell<LineIndex>,
270} 270}
271 271
@@ -279,14 +279,14 @@ impl FileData {
279 } 279 }
280 } 280 }
281 281
282 fn syntax(&self) -> &ParsedFile { 282 fn syntax(&self) -> &File {
283 self.syntax 283 self.syntax
284 .get_or_init(|| ParsedFile::parse(&self.text)) 284 .get_or_init(|| File::parse(&self.text))
285 } 285 }
286 286
287 fn syntax_transient(&self) -> ParsedFile { 287 fn syntax_transient(&self) -> File {
288 self.syntax.get().map(|s| s.clone()) 288 self.syntax.get().map(|s| s.clone())
289 .unwrap_or_else(|| ParsedFile::parse(&self.text)) 289 .unwrap_or_else(|| File::parse(&self.text))
290 } 290 }
291 291
292 fn symbols(&self) -> &FileSymbols { 292 fn symbols(&self) -> &FileSymbols {
diff --git a/crates/libanalysis/src/module_map.rs b/crates/libanalysis/src/module_map.rs
index e8d32928a..6a9104d84 100644
--- a/crates/libanalysis/src/module_map.rs
+++ b/crates/libanalysis/src/module_map.rs
@@ -4,13 +4,13 @@ use std::{
4 4
5use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; 5use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
6use libsyntax2::{ 6use libsyntax2::{
7 ParsedFile, 7 File,
8 ast::{self, AstNode, NameOwner}, 8 ast::{self, AstNode, NameOwner},
9 SyntaxNode, SmolStr, 9 SyntaxNode, SmolStr,
10}; 10};
11use {FileId, FileResolver}; 11use {FileId, FileResolver};
12 12
13type SyntaxProvider<'a> = dyn Fn(FileId) -> ParsedFile + 'a; 13type SyntaxProvider<'a> = dyn Fn(FileId) -> File + 'a;
14 14
15#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] 15#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
16pub struct ModuleId(FileId); 16pub struct ModuleId(FileId);
diff --git a/crates/libanalysis/src/symbol_index.rs b/crates/libanalysis/src/symbol_index.rs
index 426de4c76..73cbf5702 100644
--- a/crates/libanalysis/src/symbol_index.rs
+++ b/crates/libanalysis/src/symbol_index.rs
@@ -1,6 +1,6 @@
1use libeditor::{FileSymbol, file_symbols}; 1use libeditor::{FileSymbol, file_symbols};
2use libsyntax2::{ 2use libsyntax2::{
3 ParsedFile, 3 File,
4 SyntaxKind::{self, *}, 4 SyntaxKind::{self, *},
5}; 5};
6use fst::{self, IntoStreamer, Streamer}; 6use fst::{self, IntoStreamer, Streamer};
@@ -12,7 +12,7 @@ pub(crate) struct FileSymbols {
12} 12}
13 13
14impl FileSymbols { 14impl FileSymbols {
15 pub(crate) fn new(file: &ParsedFile) -> FileSymbols { 15 pub(crate) fn new(file: &File) -> FileSymbols {
16 let mut symbols = file_symbols(file) 16 let mut symbols = file_symbols(file)
17 .into_iter() 17 .into_iter()
18 .map(|s| (s.name.as_str().to_lowercase(), s)) 18 .map(|s| (s.name.as_str().to_lowercase(), s))