mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
internal: switch to tracing
from log
This commit also adds `tracing` to NotificationDispatcher/RequestDispatcher, bumps `rust-analyzer-salsa` to 0.17.0-pre.6, `always-assert` to 0.2, and removes the homegrown `hprof` implementation in favor of a vendored tracing-span-tree.
This commit is contained in:
parent
63123ab408
commit
e1ea7c8844
96 changed files with 658 additions and 825 deletions
|
@ -6,7 +6,7 @@ use ide_db::SymbolKind;
|
|||
use crate::{item::CompletionItem, render::RenderContext};
|
||||
|
||||
pub(crate) fn render_const(ctx: RenderContext<'_>, const_: hir::Const) -> Option<CompletionItem> {
|
||||
let _p = profile::span("render_const");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_const").entered();
|
||||
render(ctx, const_)
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ pub(crate) fn render_fn(
|
|||
local_name: Option<hir::Name>,
|
||||
func: hir::Function,
|
||||
) -> Builder {
|
||||
let _p = profile::span("render_fn");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_fn").entered();
|
||||
render(ctx, local_name, func, FuncKind::Function(path_ctx))
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ pub(crate) fn render_method(
|
|||
local_name: Option<hir::Name>,
|
||||
func: hir::Function,
|
||||
) -> Builder {
|
||||
let _p = profile::span("render_method");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_method").entered();
|
||||
render(ctx, local_name, func, FuncKind::Method(dot_access, receiver))
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ pub(crate) fn render_variant_lit(
|
|||
variant: hir::Variant,
|
||||
path: Option<hir::ModPath>,
|
||||
) -> Option<Builder> {
|
||||
let _p = profile::span("render_enum_variant");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_enum_variant").entered();
|
||||
let db = ctx.db();
|
||||
|
||||
let name = local_name.unwrap_or_else(|| variant.name(db));
|
||||
|
@ -41,7 +41,7 @@ pub(crate) fn render_struct_literal(
|
|||
path: Option<hir::ModPath>,
|
||||
local_name: Option<hir::Name>,
|
||||
) -> Option<Builder> {
|
||||
let _p = profile::span("render_struct_literal");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_struct_literal").entered();
|
||||
let db = ctx.db();
|
||||
|
||||
let name = local_name.unwrap_or_else(|| strukt.name(db));
|
||||
|
|
|
@ -17,7 +17,7 @@ pub(crate) fn render_macro(
|
|||
name: hir::Name,
|
||||
macro_: hir::Macro,
|
||||
) -> Builder {
|
||||
let _p = profile::span("render_macro");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_macro").entered();
|
||||
render(ctx, *kind == PathKind::Use, *has_macro_bang, *has_call_parens, name, macro_)
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ pub(crate) fn render_macro_pat(
|
|||
name: hir::Name,
|
||||
macro_: hir::Macro,
|
||||
) -> Builder {
|
||||
let _p = profile::span("render_macro");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_macro").entered();
|
||||
render(ctx, false, false, false, name, macro_)
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ pub(crate) fn render_struct_pat(
|
|||
strukt: hir::Struct,
|
||||
local_name: Option<Name>,
|
||||
) -> Option<CompletionItem> {
|
||||
let _p = profile::span("render_struct_pat");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_struct_pat").entered();
|
||||
|
||||
let fields = strukt.fields(ctx.db());
|
||||
let (visible_fields, fields_omitted) = visible_fields(ctx.completion, &fields, strukt)?;
|
||||
|
@ -50,7 +50,7 @@ pub(crate) fn render_variant_pat(
|
|||
local_name: Option<Name>,
|
||||
path: Option<&hir::ModPath>,
|
||||
) -> Option<CompletionItem> {
|
||||
let _p = profile::span("render_variant_pat");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_variant_pat").entered();
|
||||
|
||||
let fields = variant.fields(ctx.db());
|
||||
let (visible_fields, fields_omitted) = visible_fields(ctx.completion, &fields, variant)?;
|
||||
|
|
|
@ -10,7 +10,7 @@ pub(crate) fn render_type_alias(
|
|||
ctx: RenderContext<'_>,
|
||||
type_alias: hir::TypeAlias,
|
||||
) -> Option<CompletionItem> {
|
||||
let _p = profile::span("render_type_alias");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_type_alias").entered();
|
||||
render(ctx, type_alias, false)
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ pub(crate) fn render_type_alias_with_eq(
|
|||
ctx: RenderContext<'_>,
|
||||
type_alias: hir::TypeAlias,
|
||||
) -> Option<CompletionItem> {
|
||||
let _p = profile::span("render_type_alias_with_eq");
|
||||
let _p = tracing::span!(tracing::Level::INFO, "render_type_alias_with_eq").entered();
|
||||
render(ctx, type_alias, true)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue