Skip to content

Commit ca8d20e

Browse files
committed
add expandable hover experimental setting
1 parent a12778c commit ca8d20e

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

extensions/typescript-language-features/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,15 @@
14951495
"tags": [
14961496
"experimental"
14971497
]
1498+
},
1499+
"typescript.experimental.expandableHover": {
1500+
"type": "boolean",
1501+
"default": false,
1502+
"description": "%configuration.expandableHover%",
1503+
"scope": "window",
1504+
"tags": [
1505+
"experimental"
1506+
]
14981507
}
14991508
}
15001509
},

extensions/typescript-language-features/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@
237237
"configuration.tsserver.web.typeAcquisition.enabled": "Enable/disable package acquisition on the web. This enables IntelliSense for imported packages. Requires `#typescript.tsserver.web.projectWideIntellisense.enabled#`. Currently not supported for Safari.",
238238
"configuration.tsserver.nodePath": "Run TS Server on a custom Node installation. This can be a path to a Node executable, or 'node' if you want VS Code to detect a Node installation.",
239239
"configuration.updateImportsOnPaste": "Automatically update imports when pasting code. Requires TypeScript 5.6+.",
240+
"configuration.expandableHover": "(Experimental) Enable/disable expanding on hover.",
240241
"walkthroughs.nodejsWelcome.title": "Get started with JavaScript and Node.js",
241242
"walkthroughs.nodejsWelcome.description": "Make the most of Visual Studio Code's first-class JavaScript experience.",
242243
"walkthroughs.nodejsWelcome.downloadNode.forMacOrWindows.title": "Install Node.js",

extensions/typescript-language-features/src/languageFeatures/hover.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ class TypeScriptHoverProvider implements vscode.HoverProvider {
3333
return undefined;
3434
}
3535

36+
const enableExpandableHover = vscode.workspace.getConfiguration('typescript').get('experimental.expandableHover');
3637
let verbosityLevel: number | undefined;
37-
if (this.client.apiVersion.gte(API.v570)) {
38+
if (enableExpandableHover && this.client.apiVersion.gte(API.v570)) {
3839
verbosityLevel = Math.max(0, this.getPreviousLevel(context?.previousHover) + (context?.verbosityDelta ?? 0));
3940
}
4041
const args = { ...typeConverters.Position.toFileLocationRequestArgs(filepath, position), verbosityLevel };

0 commit comments

Comments
 (0)