aboutsummaryrefslogtreecommitdiff
path: root/crates/assists
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-11-27 16:14:04 +0000
committerGitHub <[email protected]>2020-11-27 16:14:04 +0000
commit0993f9067cfc14cded484906283d1df8e8741e8e (patch)
tree235ecf5049b1af3ed8fdf35cad5b66ceb8f28ff4 /crates/assists
parentc66d477f5a72247b04b9025f6ba9c403ca628d41 (diff)
parent04cd4b17bb04031ecf7c7e9b734d22ea74d8f114 (diff)
Merge #6651
6651: Profile completions better r=SomeoneToIgnore a=SomeoneToIgnore During https://github.com/rust-analyzer/rust-analyzer/issues/6612 investigation, had added a few more profiling points and considered that they can be useful later, ergo the PR. Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/assists')
-rw-r--r--crates/assists/src/utils.rs1
-rw-r--r--crates/assists/src/utils/insert_use.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/crates/assists/src/utils.rs b/crates/assists/src/utils.rs
index 66c0cdd5f..048746587 100644
--- a/crates/assists/src/utils.rs
+++ b/crates/assists/src/utils.rs
@@ -25,6 +25,7 @@ use crate::{
25pub use insert_use::{insert_use, ImportScope, MergeBehaviour}; 25pub use insert_use::{insert_use, ImportScope, MergeBehaviour};
26 26
27pub fn mod_path_to_ast(path: &hir::ModPath) -> ast::Path { 27pub fn mod_path_to_ast(path: &hir::ModPath) -> ast::Path {
28 let _p = profile::span("mod_path_to_ast");
28 let mut segments = Vec::new(); 29 let mut segments = Vec::new();
29 let mut is_abs = false; 30 let mut is_abs = false;
30 match path.kind { 31 match path.kind {
diff --git a/crates/assists/src/utils/insert_use.rs b/crates/assists/src/utils/insert_use.rs
index 423782a0e..304adb93d 100644
--- a/crates/assists/src/utils/insert_use.rs
+++ b/crates/assists/src/utils/insert_use.rs
@@ -95,6 +95,7 @@ pub fn insert_use<'a>(
95 path: ast::Path, 95 path: ast::Path,
96 merge: Option<MergeBehaviour>, 96 merge: Option<MergeBehaviour>,
97) -> SyntaxRewriter<'a> { 97) -> SyntaxRewriter<'a> {
98 let _p = profile::span("insert_use");
98 let mut rewriter = SyntaxRewriter::default(); 99 let mut rewriter = SyntaxRewriter::default();
99 let use_item = make::use_(make::use_tree(path.clone(), None, None, false)); 100 let use_item = make::use_(make::use_tree(path.clone(), None, None, false));
100 // merge into existing imports if possible 101 // merge into existing imports if possible