deno
05fb59f0 - refactor(lsp): convert TextSpan off serde_v8, flip getEncodedSemanticClassifications

Commit
110 days ago
refactor(lsp): convert TextSpan off serde_v8, flip getEncodedSemanticClassifications Continues the incremental `TscRequest::into_server_request` conversion (see `refactor(lsp): convert UserPreferences and its enum deps off serde_v8`): `TextSpan` (cli/lsp/tsc.rs, a plain `{start, length}` pair) now derives `deno_core::ToV8` alongside its existing `Serialize`. `TscRequest::GetEncodedSemanticClassifications`'s payload `(String, TextSpan, &'static str)` only needed `TextSpan` to have `ToV8` (`String` and `&'static str` already did), so it flips from the `serde_v8::to_v8` fallback to the generic tuple `ToV8` -- a real call-site elimination. `TscRequest::ProvideInlayHints`'s payload `(String, TextSpan, UserPreferences)` also needs `TextSpan`, but additionally needs `UserPreferences`, which isn't on `main` yet (still in flight as an unmerged PR). Left it on `serde_v8::to_v8` with a comment explaining why, rather than stacking this PR on that one's unmerged branch. Verified behavior preservation: - `cargo test -p deno --lib lsp::tsc` (21 tests) - `cargo test -p integration_tests --test integration -- lsp_semantic_token`: real `textDocument/semanticTokens/full` requests through the converted `GetEncodedSemanticClassifications` match arm. `lsp_semantic_tokens` and `lsp_semantic_token_caching` (which explicitly asserts the `tsc.request.getEncodedSemanticClassifications` call count) both pass. `lsp_semantic_tokens_for_disabled_module` fails in this sandbox, but that's the same pre-existing sandbox/network limitation documented in the UserPreferences PR (shared test_server crashes trying to download an esbuild binary it can't reach), not a regression. - `cargo check`/clippy -D warnings clean on deno
Author
Parents
Loading