mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
switch to upstream rowan's API
This commit is contained in:
parent
7bde8012cb
commit
c9cfd57eea
22 changed files with 208 additions and 738 deletions
|
@ -1,7 +1,7 @@
|
|||
use crate::db::RootDatabase;
|
||||
use ra_db::SourceDatabase;
|
||||
use ra_syntax::{
|
||||
algo, AstNode, SourceFile, SyntaxElement,
|
||||
algo, AstNode, NodeOrToken, SourceFile,
|
||||
SyntaxKind::{RAW_STRING, STRING},
|
||||
SyntaxToken, TextRange,
|
||||
};
|
||||
|
@ -16,8 +16,8 @@ pub(crate) fn syntax_tree(
|
|||
let parse = db.parse(file_id);
|
||||
if let Some(text_range) = text_range {
|
||||
let node = match algo::find_covering_element(parse.tree().syntax(), text_range) {
|
||||
SyntaxElement::Node(node) => node,
|
||||
SyntaxElement::Token(token) => {
|
||||
NodeOrToken::Node(node) => node,
|
||||
NodeOrToken::Token(token) => {
|
||||
if let Some(tree) = syntax_tree_for_string(&token, text_range) {
|
||||
return tree;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue