diff --git a/docs/configuration/language-server-settings.md b/docs/configuration/language-server-settings.md index e7fa61c73..dffaaf04f 100644 --- a/docs/configuration/language-server-settings.md +++ b/docs/configuration/language-server-settings.md @@ -48,7 +48,7 @@ the following settings are exclusive to basedpyright ![](inlayHints.functionReturnTypes.png) -**basedpyright.analysis.inlayHints.genericTypes** [boolean]: Whether to show inlay hints on inferred generic types. (currently only works on `Final` and `ClassVar`): +**basedpyright.analysis.inlayHints.genericTypes** [boolean]: Whether to show inlay hints on inferred generic types. Defaults to `false`: ![](inlayHints.genericTypes.png) diff --git a/packages/pyright-internal/src/languageServerBase.ts b/packages/pyright-internal/src/languageServerBase.ts index 60f0d886b..0fec7a0ac 100644 --- a/packages/pyright-internal/src/languageServerBase.ts +++ b/packages/pyright-internal/src/languageServerBase.ts @@ -1011,7 +1011,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface, Dis callArgumentNames: inlayHintSettings?.callArgumentNames ?? true, functionReturnTypes: inlayHintSettings?.functionReturnTypes ?? true, variableTypes: inlayHintSettings?.variableTypes ?? true, - genericTypes: inlayHintSettings?.genericTypes ?? true, + genericTypes: inlayHintSettings?.genericTypes ?? false, }).onInlayHints(); }, token); } diff --git a/packages/pyright-internal/src/realLanguageServer.ts b/packages/pyright-internal/src/realLanguageServer.ts index 31da77560..e9f27e94a 100644 --- a/packages/pyright-internal/src/realLanguageServer.ts +++ b/packages/pyright-internal/src/realLanguageServer.ts @@ -102,7 +102,12 @@ export abstract class RealLanguageServer extends LanguageServerBase { logLevel: LogLevel.Info, autoImportCompletions: true, functionSignatureDisplay: SignatureDisplayType.formatted, - inlayHints: { callArgumentNames: true, functionReturnTypes: true, variableTypes: true, genericTypes: true }, + inlayHints: { + callArgumentNames: true, + functionReturnTypes: true, + variableTypes: true, + genericTypes: false, + }, }; try { diff --git a/packages/vscode-pyright/package.json b/packages/vscode-pyright/package.json index 968797e21..2066f9fee 100644 --- a/packages/vscode-pyright/package.json +++ b/packages/vscode-pyright/package.json @@ -1764,7 +1764,7 @@ }, "basedpyright.analysis.inlayHints.genericTypes": { "type": "boolean", - "default": true, + "default": false, "description": "Whether to show inlay hints on inferred generic types.", "scope": "resource" }