From 53b54bc98571b9349af75e7929389c3c43134068 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:48:18 -0800 Subject: [PATCH] Disable TypeScript inlay hints in Playground v2 for TS 6 and below The Strada language service enabled every inlay hint category, so TypeScript 6 and older cluttered the editor with parameter, variable, and return type hints. The native TS 7 path only shows ^? query results, so both compiler paths now display the same hints. --- packages/playground-v2/src/strada.ts | 32 --------------------- packages/playground-v2/src/strada.worker.ts | 10 ------- 2 files changed, 42 deletions(-) diff --git a/packages/playground-v2/src/strada.ts b/packages/playground-v2/src/strada.ts index ee2fe0cd1649..d06c3f852aa5 100644 --- a/packages/playground-v2/src/strada.ts +++ b/packages/playground-v2/src/strada.ts @@ -541,38 +541,6 @@ export class StradaBackend { if (token.isCancellationRequested || model.isDisposed() || model.getVersionId() !== version) return empty return { actions, dispose() {} } }, - }), - monaco.languages.registerInlayHintsProvider(language, { - provideInlayHints: async (model, range) => { - await this.updateFiles() - const start = model.getOffsetAt(range.getStartPosition()) - const end = model.getOffsetAt(range.getEndPosition()) - const hints = await this.#request("inlayHints", { - fileName: model.uri.path, - preferences: { - includeInlayEnumMemberValueHints: true, - includeInlayFunctionLikeReturnTypeHints: true, - includeInlayFunctionParameterTypeHints: true, - includeInlayParameterNameHints: "literals", - includeInlayParameterNameHintsWhenArgumentMatchesName: false, - includeInlayPropertyDeclarationTypeHints: true, - includeInlayVariableTypeHints: true, - includeInlayVariableTypeHintsWhenTypeMatchesName: false, - }, - span: { length: end - start, start }, - }) - return { - dispose() {}, - hints: hints.map(hint => ({ - kind: - hint.kind === "Type" ? monaco.languages.InlayHintKind.Type : monaco.languages.InlayHintKind.Parameter, - label: hint.text, - paddingLeft: hint.whitespaceBefore, - paddingRight: hint.whitespaceAfter, - position: model.getPositionAt(hint.position), - })), - } - }, }) ) } diff --git a/packages/playground-v2/src/strada.worker.ts b/packages/playground-v2/src/strada.worker.ts index 4ca72ded9527..3ba6f33fa582 100644 --- a/packages/playground-v2/src/strada.worker.ts +++ b/packages/playground-v2/src/strada.worker.ts @@ -164,16 +164,6 @@ async function dispatch(method: string, args: any) { args.formatOptions, args.preferences ) - case "inlayHints": { - const serviceWithHints = service as import("typescript").LanguageService & { - provideInlayHints?( - fileName: string, - span: import("typescript").TextSpan, - preferences: import("typescript").UserPreferences - ): readonly any[] - } - return serviceWithHints.provideInlayHints?.(args.fileName, args.span, args.preferences) ?? [] - } case "readFile": return readFile(args.fileName) default: