mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
add profile calls to parsing/expansion routines
This commit is contained in:
parent
67d5927b16
commit
f15bb3c98a
3 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,7 @@ use std::{
|
|||
|
||||
use ra_db::{FileId, salsa};
|
||||
use ra_syntax::{TreeArc, AstNode, ast, SyntaxNode};
|
||||
use ra_prof::profile;
|
||||
use mbe::MacroRules;
|
||||
|
||||
use crate::{
|
||||
|
@ -60,6 +61,7 @@ impl HirFileId {
|
|||
db: &impl DefDatabase,
|
||||
file_id: HirFileId,
|
||||
) -> Option<TreeArc<SyntaxNode>> {
|
||||
let _p = profile("parse_or_expand_query");
|
||||
match file_id.0 {
|
||||
HirFileIdRepr::File(file_id) => Some(db.parse(file_id).syntax().to_owned()),
|
||||
HirFileIdRepr::Macro(macro_file) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue