[ts-plugin] Preserve TypeScript quick info metadata#95863
Merged
Conversation
Contributor
Tests PassedCommit: 51ba8b2 |
Contributor
Stats from current PR🟢 1 improvement
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (2 files)Files with changes:
View diffspages-api.runtime.dev.jsDiff too large to display pages.runtime.dev.jsDiff too large to display 📎 Tarball URLCommit: 51ba8b2 |
devjiwonchoi
force-pushed
the
jiwon/ts-plugin-preserve-quick-info
branch
from
July 16, 2026 14:58
ce7335e to
51ba8b2
Compare
devjiwonchoi
marked this pull request as ready for review
July 23, 2026 21:22
timneutkens
approved these changes
Jul 24, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
VS Code passes a maximum hover length and verbosity level to TypeScript's
getQuickInfoAtPositionAPI when a user expands a hover. The Next.js TypeScript plugin intercepted that call and forwarded the file name and position, dropping the remaining arguments. The plugin also replaced TypeScript'sQuickInfoobject when it added config documentation, which discarded native fields such ascanIncreaseVerbosityLevel. As a result, hovers for Next.js config exports could not expand and lost native type information.This supersedes #86290 with a narrower behavior change. The plugin preserves native
QuickInfowhen it adds documentation to valid config values and config identifiers. Invalid config values keep the existing synthesized override, and hovers inside function initializers retain TypeScript's existing behavior.x-ref: microsoft/vscode#232685 (comment)
How?
The plugin forwards all QuickInfo arguments to TypeScript and passes the native result into the config hover rules. For valid config values and identifiers, those rules copy the native
QuickInfofields and append the Next.js documentation. They synthesize the existing fallback when TypeScript returns no QuickInfo.Focused tests cover argument forwarding, metadata preservation, missing native QuickInfo, invalid config values, and function config boundaries.
Test plan
Open a minimal Next.js app in Cursor with workspace TypeScript 6.0.2 and the package built from this PR. Hover
export const metadata: Metadata, then select the expansion control. The hover expands fromMetadatato its full property type while the Next.js config documentation and link remain visible.