mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
make Parse fields private
this is in preparation for the new rowan API
This commit is contained in:
parent
2e466bb365
commit
deab4caa7b
31 changed files with 109 additions and 99 deletions
|
@ -94,7 +94,8 @@ fn hover_text(docs: Option<String>, desc: Option<String>) -> Option<String> {
|
|||
}
|
||||
|
||||
pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeInfo<HoverResult>> {
|
||||
let file = db.parse(position.file_id).tree;
|
||||
let parse = db.parse(position.file_id);
|
||||
let file = parse.tree();
|
||||
let mut res = HoverResult::new();
|
||||
|
||||
let mut range = None;
|
||||
|
@ -241,8 +242,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
}
|
||||
|
||||
pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option<String> {
|
||||
let file = db.parse(frange.file_id).tree;
|
||||
let syntax = file.syntax();
|
||||
let parse = db.parse(frange.file_id);
|
||||
let syntax = parse.tree().syntax();
|
||||
let leaf_node = find_covering_element(syntax, frange.range);
|
||||
// if we picked identifier, expand to pattern/expression
|
||||
let node = leaf_node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue