Skip to content

Commit ec6fb8d

Browse files
committed
Add profiling around add_impl_members
This intention is pretty slow for `impl Interator`, because it has a ton of default methods which need to be substituted. The proper fix here is to not compute the actual edit until the user triggers the action, but that's awkward to do in the LSP right now, so let's just put a profiling code for now.
1 parent ea9d18b commit ec6fb8d

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ra_assists/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ either = "1.5"
1616
ra_syntax = { path = "../ra_syntax" }
1717
ra_text_edit = { path = "../ra_text_edit" }
1818
ra_fmt = { path = "../ra_fmt" }
19+
ra_prof = { path = "../ra_prof" }
1920
ra_db = { path = "../ra_db" }
2021
hir = { path = "../ra_hir", package = "ra_hir" }
2122
test_utils = { path = "../test_utils" }

crates/ra_assists/src/assists/add_missing_impl_members.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ fn add_missing_impl_members_inner(
9999
assist_id: &'static str,
100100
label: &'static str,
101101
) -> Option<Assist> {
102+
let _p = ra_prof::profile("add_missing_impl_members_inner");
102103
let impl_node = ctx.find_node_at_offset::<ast::ImplBlock>()?;
103104
let impl_item_list = impl_node.item_list()?;
104105

0 commit comments

Comments
 (0)