From 00c0c567dcf0ef7241176ea0213652d56c154606 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Thu, 2 Oct 2025 13:15:28 -0400 Subject: [PATCH] [ruff,ty] Enable tracing's `log` feature This has the effect of emitting tracing events via `log` whenever there isn't an active tracing subscriber present. This makes it so `ty_wasm` logs tracing messages to the JavaScript console automatically (via our use of `console_log`). --- Cargo.lock | 1 + crates/ty_wasm/Cargo.toml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 6eee6d912c..80fcc63080 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4449,6 +4449,7 @@ dependencies = [ "ruff_source_file", "ruff_text_size", "serde-wasm-bindgen", + "tracing", "ty_ide", "ty_project", "ty_python_semantic", diff --git a/crates/ty_wasm/Cargo.toml b/crates/ty_wasm/Cargo.toml index 42dfb66118..4ce9913eda 100644 --- a/crates/ty_wasm/Cargo.toml +++ b/crates/ty_wasm/Cargo.toml @@ -40,6 +40,7 @@ log = { workspace = true } # See https://docs.rs/getrandom/latest/getrandom/#webassembly-support getrandom = { workspace = true, features = ["wasm_js"] } serde-wasm-bindgen = { workspace = true } +tracing = { workspace = true, features = ["log"] } # Not a direct dependency but required to compile for Wasm. uuid = { workspace = true, features = ["js"] } @@ -50,3 +51,7 @@ wasm-bindgen-test = { workspace = true } [lints] workspace = true + +[package.metadata.cargo-shear] +# Depended on only to enable `log` feature as of 2025-10-03. +ignored = ["tracing"]