[ty] Fix file root matching for / by BurntSushi · Pull Request #20684 · astral-sh/ruff (original) (raw)

@BurntSushi BurntSushi changed the titleag/fix 1277 [ty] Fix file root matching for /

Oct 2, 2025

ibraheemdev

MichaReiser

@BurntSushi

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).

@BurntSushi

Previously, we would always add /{*filepath} as our wildcard to match descendant paths. But when the root is just / (as it can be in tests, weird environments or in the ty playground), this causes a double / and inhibits most descendant matches.

The regression test added in this commit fails without this fix. Specifically, it panics because it can't find a file root for /project.

Fixes #1277

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})