Skip to content

feat(lsp): add inferred type request#35099

Open
divybot wants to merge 4 commits into
mainfrom
orch/divybot-425
Open

feat(lsp): add inferred type request#35099
divybot wants to merge 4 commits into
mainfrom
orch/divybot-425

Conversation

@divybot

@divybot divybot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Adds a deno/inferredType custom LSP request that returns the full TypeScript QuickInfo display string and source range for the symbol at a text document position. The TypeScript quick-info bridge now passes an explicit large maximumLength, so hover and inferred-type callers avoid the default truncation.

Also advertises a refactor.extract.inferredType code action titled "Copy inferred type". The code action carries the precomputed inferred type text as command data, giving clients a discoverable native entry point for copying full inferred type text while allowing editor extensions to own clipboard access.

Companion VS Code extension PR: denoland/vscode_deno#1381

Verification:

  • cargo build --bin deno
  • cargo fmt --check
  • cargo test -p integration_tests --test integration lsp_inferred_type -- --nocapture
  • cargo build -p test_server
  • cargo test -p integration_tests --test integration lsp_hover -- --nocapture

Refs #23901
Closes denoland/divybot#425

divybot and others added 2 commits June 10, 2026 12:08
…ties

TypeScript's "Infer function return type" refactor already executes
through the LSP, but its code action kind was not in
ALL_KNOWN_REFACTOR_ACTION_KINDS so the kind was never advertised in the
server's InitializeResult. Clients like vscode use that list to populate
the "Refactor..." menu; without the kind they cannot surface the action
via the standard refactor UI.

This lets users discover and invoke "Infer function return type" to see
and copy the full inferred return type for any function — a workaround
for vscode's truncated type peek window.

Refs #23901

Closes denoland/divybot#425

Co-Authored-By: Divy Srivastava <me@littledivy.com>
Co-Authored-By: Divy Srivastava <me@littledivy.com>
@divybot divybot changed the title feat(lsp): advertise refactor.rewrite.function.returnType in capabilities feat(lsp): add inferred type request Jun 12, 2026
Co-Authored-By: Divy Srivastava <me@littledivy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant