mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
ra_db is independent from editor
This commit is contained in:
parent
0c88360eb4
commit
695294bbb9
7 changed files with 28 additions and 24 deletions
|
@ -5,9 +5,6 @@ mod input;
|
|||
mod loc2id;
|
||||
pub mod mock;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use ra_editor::LineIndex;
|
||||
use ra_syntax::{TextUnit, TextRange, SourceFile, TreePtr};
|
||||
|
||||
pub use crate::{
|
||||
|
@ -36,9 +33,6 @@ salsa::query_group! {
|
|||
fn source_file(file_id: FileId) -> TreePtr<SourceFile> {
|
||||
type SourceFileQuery;
|
||||
}
|
||||
fn file_lines(file_id: FileId) -> Arc<LineIndex> {
|
||||
type FileLinesQuery;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,10 +40,6 @@ fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreePtr<SourceFile>
|
|||
let text = db.file_text(file_id);
|
||||
SourceFile::parse(&*text)
|
||||
}
|
||||
fn file_lines(db: &impl SyntaxDatabase, file_id: FileId) -> Arc<LineIndex> {
|
||||
let text = db.file_text(file_id);
|
||||
Arc::new(LineIndex::new(&*text))
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct FilePosition {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue