mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
migrate ra_db to new rowan
This commit is contained in:
parent
b88775af7f
commit
fe53b28250
3 changed files with 20 additions and 11 deletions
|
@ -8,7 +8,7 @@ pub mod mock;
|
|||
use std::sync::Arc;
|
||||
|
||||
use ra_editor::LineIndex;
|
||||
use ra_syntax::{TextUnit, TextRange, SourceFileNode};
|
||||
use ra_syntax::{TextUnit, TextRange, SourceFile, TreePtr};
|
||||
|
||||
pub use crate::{
|
||||
cancelation::{Canceled, Cancelable},
|
||||
|
@ -47,7 +47,7 @@ pub trait BaseDatabase: salsa::Database {
|
|||
|
||||
salsa::query_group! {
|
||||
pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase {
|
||||
fn source_file(file_id: FileId) -> SourceFileNode {
|
||||
fn source_file(file_id: FileId) -> TreePtr<SourceFile> {
|
||||
type SourceFileQuery;
|
||||
}
|
||||
fn file_lines(file_id: FileId) -> Arc<LineIndex> {
|
||||
|
@ -56,9 +56,9 @@ salsa::query_group! {
|
|||
}
|
||||
}
|
||||
|
||||
fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> SourceFileNode {
|
||||
fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreePtr<SourceFile> {
|
||||
let text = db.file_text(file_id);
|
||||
SourceFileNode::parse(&*text)
|
||||
SourceFile::parse(&*text)
|
||||
}
|
||||
fn file_lines(db: &impl SyntaxDatabase, file_id: FileId) -> Arc<LineIndex> {
|
||||
let text = db.file_text(file_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue