fix: Tracing span names should match function names

When viewing traces, it's slightly confusing when the span name doesn't
match the function name. Ensure the names are consistent.

(It might be worth moving most of these to use #[tracing::instrument]
so the name can never go stale. @davidbarsky suggested that is marginally
slower, so I've just done the simple change here.)
This commit is contained in:
Wilfred Hughes 2024-04-26 17:00:58 -07:00
parent 1bf1f6e0a1
commit c981ff0944
20 changed files with 31 additions and 31 deletions

View file

@ -368,7 +368,7 @@ fn render_resolution_pat(
import_to_add: Option<LocatedImport>,
resolution: ScopeDef,
) -> Builder {
let _p = tracing::span!(tracing::Level::INFO, "render_resolution").entered();
let _p = tracing::span!(tracing::Level::INFO, "render_resolution_pat").entered();
use hir::ModuleDef::*;
if let ScopeDef::ModuleDef(Macro(mac)) = resolution {
@ -386,7 +386,7 @@ fn render_resolution_path(
import_to_add: Option<LocatedImport>,
resolution: ScopeDef,
) -> Builder {
let _p = tracing::span!(tracing::Level::INFO, "render_resolution").entered();
let _p = tracing::span!(tracing::Level::INFO, "render_resolution_path").entered();
use hir::ModuleDef::*;
match resolution {
@ -494,7 +494,7 @@ fn render_resolution_simple_(
import_to_add: Option<LocatedImport>,
resolution: ScopeDef,
) -> Builder {
let _p = tracing::span!(tracing::Level::INFO, "render_resolution").entered();
let _p = tracing::span!(tracing::Level::INFO, "render_resolution_simple_").entered();
let db = ctx.db();
let ctx = ctx.import_to_add(import_to_add);