[ty] Fix file root matching for / by BurntSushi · Pull Request #20684 · astral-sh/ruff (original) (raw)
BurntSushi changed the title
ag/fix 1277 [ty] Fix file root matching for /
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).
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 }})