mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
rename source_file -> parse
This commit is contained in:
parent
ac757e114e
commit
9457b1f0e6
19 changed files with 41 additions and 47 deletions
|
@ -7,7 +7,7 @@ use ra_syntax::{
|
|||
use crate::{db::RootDatabase, RangeInfo, FilePosition, FileRange, NavigationTarget};
|
||||
|
||||
pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeInfo<String>> {
|
||||
let file = db.source_file(position.file_id);
|
||||
let file = db.parse(position.file_id);
|
||||
let mut res = Vec::new();
|
||||
|
||||
let mut range = None;
|
||||
|
@ -53,7 +53,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
}
|
||||
|
||||
pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> {
|
||||
let file = db.source_file(frange.file_id);
|
||||
let file = db.parse(frange.file_id);
|
||||
let syntax = file.syntax();
|
||||
let leaf_node = find_covering_node(syntax, frange.range);
|
||||
// if we picked identifier, expand to pattern/expression
|
||||
|
@ -88,7 +88,7 @@ fn doc_text_for(db: &RootDatabase, nav: NavigationTarget) -> Option<String> {
|
|||
|
||||
impl NavigationTarget {
|
||||
fn node(&self, db: &RootDatabase) -> Option<TreeArc<SyntaxNode>> {
|
||||
let source_file = db.source_file(self.file_id());
|
||||
let source_file = db.parse(self.file_id());
|
||||
let source_file = source_file.syntax();
|
||||
let node = source_file
|
||||
.descendants()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue