oxc/crates/oxc_language_server/src
rzvxa 4d2b7f1227 refactor(linter): LintContext can now only be constructed with a cfg enabled semantic. (#3761)
It has the same spirit as #3747 but with a much simpler approach. I've used the fact that @Boshen mentioned about linter always using CFG so now we assert `semantic.cfg().is_some()` in the `LintContext::new` because of this assertion we can have a `LintContext::cfg` that unwraps unchecked.
Eliminates unnecessary checks in our hot paths.

It has the best of both worlds, No complicated typing yet we still get the CFG as a non-optional value without extra ASM or branching.
2024-06-19 13:01:33 +00:00
..
linter.rs refactor(linter): LintContext can now only be constructed with a cfg enabled semantic. (#3761) 2024-06-19 13:01:33 +00:00
main.rs chore: improve some format by running cargo +nightly fmt 2024-06-19 00:48:30 +08:00