From 208b7bd7ba687fb570feb1b89219f14c63712ce8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 16:32:36 +0200 Subject: Rename ra_prof -> profile --- crates/ra_ide/Cargo.toml | 2 +- crates/ra_ide/src/diagnostics.rs | 3 +-- crates/ra_ide/src/inlay_hints.rs | 3 +-- crates/ra_ide/src/lib.rs | 2 +- crates/ra_ide/src/references.rs | 3 +-- crates/ra_ide/src/status.rs | 2 +- crates/ra_ide/src/syntax_highlighting.rs | 3 +-- 7 files changed, 7 insertions(+), 11 deletions(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/Cargo.toml b/crates/ra_ide/Cargo.toml index f4181c4eb..bbc9ba4e7 100644 --- a/crates/ra_ide/Cargo.toml +++ b/crates/ra_ide/Cargo.toml @@ -27,7 +27,7 @@ ra_db = { path = "../ra_db" } ra_ide_db = { path = "../ra_ide_db" } ra_cfg = { path = "../ra_cfg" } ra_fmt = { path = "../ra_fmt" } -ra_prof = { path = "../ra_prof" } +profile = { path = "../profile" } test_utils = { path = "../test_utils" } ra_assists = { path = "../ra_assists" } ra_ssr = { path = "../ra_ssr" } diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index 1046d7ab3..07bf133bd 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs @@ -10,7 +10,6 @@ use hir::{diagnostics::DiagnosticSinkBuilder, Semantics}; use itertools::Itertools; use ra_db::SourceDatabase; use ra_ide_db::RootDatabase; -use ra_prof::profile; use ra_syntax::{ ast::{self, AstNode}, SyntaxNode, TextRange, T, @@ -33,7 +32,7 @@ pub(crate) fn diagnostics( file_id: FileId, enable_experimental: bool, ) -> Vec { - let _p = profile("diagnostics"); + let _p = profile::span("diagnostics"); let sema = Semantics::new(db); let parse = db.parse(file_id); let mut res = Vec::new(); diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 1bacead63..920b04e8d 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs @@ -1,6 +1,5 @@ use hir::{Adt, Callable, HirDisplay, Semantics, Type}; use ra_ide_db::RootDatabase; -use ra_prof::profile; use ra_syntax::{ ast::{self, ArgListOwner, AstNode}, match_ast, Direction, NodeOrToken, SmolStr, SyntaxKind, TextRange, T, @@ -64,7 +63,7 @@ pub(crate) fn inlay_hints( file_id: FileId, config: &InlayHintsConfig, ) -> Vec { - let _p = profile("inlay_hints"); + let _p = profile::span("inlay_hints"); let sema = Semantics::new(db); let file = sema.parse(file_id); diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 89fcb6f17..bfcf5d750 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -176,7 +176,7 @@ impl AnalysisHost { self.db.collect_garbage(); } /// NB: this clears the database - pub fn per_query_memory_usage(&mut self) -> Vec<(String, ra_prof::Bytes)> { + pub fn per_query_memory_usage(&mut self) -> Vec<(String, profile::Bytes)> { self.db.per_query_memory_usage() } pub fn request_cancellation(&mut self) { diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 453985de3..c4eea3a45 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -17,7 +17,6 @@ use ra_ide_db::{ search::SearchScope, RootDatabase, }; -use ra_prof::profile; use ra_syntax::{ algo::find_node_at_offset, ast::{self, NameOwner}, @@ -90,7 +89,7 @@ pub(crate) fn find_all_refs( position: FilePosition, search_scope: Option, ) -> Option> { - let _p = profile("find_all_refs"); + let _p = profile::span("find_all_refs"); let syntax = sema.parse(position.file_id).syntax().clone(); let (opt_name, search_kind) = if let Some(name) = diff --git a/crates/ra_ide/src/status.rs b/crates/ra_ide/src/status.rs index 08e6f69cb..009bb662f 100644 --- a/crates/ra_ide/src/status.rs +++ b/crates/ra_ide/src/status.rs @@ -1,6 +1,7 @@ use std::{fmt, iter::FromIterator, sync::Arc}; use hir::MacroFile; +use profile::{memory_usage, Bytes}; use ra_db::{ salsa::debug::{DebugQueryTable, TableEntry}, FileTextQuery, SourceRootId, @@ -9,7 +10,6 @@ use ra_ide_db::{ symbol_index::{LibrarySymbolsQuery, SymbolIndex}, RootDatabase, }; -use ra_prof::{memory_usage, Bytes}; use ra_syntax::{ast, Parse, SyntaxNode}; use rustc_hash::FxHashMap; diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index c10e15db8..ebdf05127 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -9,7 +9,6 @@ use ra_ide_db::{ defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass}, RootDatabase, }; -use ra_prof::profile; use ra_syntax::{ ast::{self, HasFormatSpecifier}, AstNode, AstToken, Direction, NodeOrToken, SyntaxElement, @@ -46,7 +45,7 @@ pub(crate) fn highlight( range_to_highlight: Option, syntactic_name_ref_highlighting: bool, ) -> Vec { - let _p = profile("highlight"); + let _p = profile::span("highlight"); let sema = Semantics::new(db); // Determine the root based on the given range. -- cgit v1.2.3