make Parse fields private
this is in preparation for the new rowan API
This commit is contained in:
@@ -13,9 +13,9 @@ pub(crate) fn syntax_tree(
|
||||
file_id: FileId,
|
||||
text_range: Option<TextRange>,
|
||||
) -> String {
|
||||
let parse = db.parse(file_id);
|
||||
if let Some(text_range) = text_range {
|
||||
let file = db.parse(file_id).tree;
|
||||
let node = match algo::find_covering_element(file.syntax(), text_range) {
|
||||
let node = match algo::find_covering_element(parse.tree().syntax(), text_range) {
|
||||
SyntaxElement::Node(node) => node,
|
||||
SyntaxElement::Token(token) => {
|
||||
if let Some(tree) = syntax_tree_for_string(token, text_range) {
|
||||
@@ -27,7 +27,7 @@ pub(crate) fn syntax_tree(
|
||||
|
||||
node.debug_dump()
|
||||
} else {
|
||||
db.parse(file_id).tree.syntax().debug_dump()
|
||||
parse.tree().syntax().debug_dump()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ fn syntax_tree_for_token(node: SyntaxToken, text_range: TextRange) -> Option<Str
|
||||
|
||||
// If the "file" parsed without errors,
|
||||
// return its syntax
|
||||
if parsed.errors.is_empty() {
|
||||
return Some(parsed.tree.syntax().debug_dump());
|
||||
if parsed.errors().is_empty() {
|
||||
return Some(parsed.tree().syntax().debug_dump());
|
||||
}
|
||||
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user