mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Remove inherent methods from ast node that carry semantic meaning
This commit is contained in:
parent
13da3d93f9
commit
151afdfe5c
15 changed files with 392 additions and 365 deletions
|
@ -2,7 +2,7 @@ use hir::Semantics;
|
|||
use ide_db::{
|
||||
base_db::FilePosition,
|
||||
defs::{Definition, NameClass, NameRefClass},
|
||||
helpers::{for_each_break_expr, for_each_tail_expr, pick_best_token},
|
||||
helpers::{for_each_break_expr, for_each_tail_expr, node_ext::walk_expr, pick_best_token},
|
||||
search::{FileReference, ReferenceAccess, SearchScope},
|
||||
RootDatabase,
|
||||
};
|
||||
|
@ -122,7 +122,7 @@ fn highlight_exit_points(
|
|||
) -> Option<Vec<HighlightedRange>> {
|
||||
let mut highlights = Vec::new();
|
||||
let body = body?;
|
||||
body.walk(&mut |expr| match expr {
|
||||
walk_expr(&body, &mut |expr| match expr {
|
||||
ast::Expr::ReturnExpr(expr) => {
|
||||
if let Some(token) = expr.return_token() {
|
||||
highlights.push(HighlightedRange { access: None, range: token.text_range() });
|
||||
|
@ -243,7 +243,7 @@ fn highlight_yield_points(token: SyntaxToken) -> Option<Vec<HighlightedRange>> {
|
|||
let mut highlights =
|
||||
vec![HighlightedRange { access: None, range: async_token?.text_range() }];
|
||||
if let Some(body) = body {
|
||||
body.walk(&mut |expr| {
|
||||
walk_expr(&body, &mut |expr| {
|
||||
if let ast::Expr::AwaitExpr(expr) = expr {
|
||||
if let Some(token) = expr.await_token() {
|
||||
highlights
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue