Skip to content

Commit 56e2f3c

Browse files
committed
refactor config path
1 parent c2822f8 commit 56e2f3c

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

extensions/typescript-language-features/package.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -481,17 +481,11 @@
481481
"experimental"
482482
]
483483
},
484-
"typescript.maximumHoverLength": {
484+
"js/ts.hover.maximumLength": {
485485
"type": "number",
486486
"default": 500,
487-
"description": "%configuration.maximumHoverLength%",
488-
"scope": "window"
489-
},
490-
"javascript.maximumHoverLength": {
491-
"type": "number",
492-
"default": 500,
493-
"description": "%configuration.maximumHoverLength%",
494-
"scope": "window"
487+
"description": "%configuration.hover.maximumLength%",
488+
"scope": "resource"
495489
}
496490
}
497491
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
"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.",
232232
"configuration.updateImportsOnPaste": "Automatically update imports when pasting code. Requires TypeScript 5.6+.",
233233
"configuration.expandableHover": "Enable expanding/contracting the hover to reveal more/less information from the TS server. Requires TypeScript 5.9+.",
234-
"configuration.maximumHoverLength": "The maximum number of characters in a hover. If the hover is longer than this, it will be truncated. Requires TypeScript 5.9+.",
234+
"configuration.hover.maximumLength": "The maximum number of characters in a hover. If the hover is longer than this, it will be truncated. Requires TypeScript 5.9+.",
235235
"walkthroughs.nodejsWelcome.title": "Get started with JavaScript and Node.js",
236236
"walkthroughs.nodejsWelcome.description": "Make the most of Visual Studio Code's first-class JavaScript experience.",
237237
"walkthroughs.nodejsWelcome.downloadNode.forMacOrWindows.title": "Install Node.js",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export default class FileConfigurationManager extends Disposable {
209209
...getInlayHintsPreferences(config),
210210
...this.getOrganizeImportsPreferences(preferencesConfig),
211211
// @ts-expect-error until TS 5.9
212-
maximumHoverLength: this.getMaximumHoverLength(config),
212+
maximumHoverLength: this.getMaximumHoverLength(document),
213213
};
214214

215215
return preferences;
@@ -261,9 +261,9 @@ export default class FileConfigurationManager extends Disposable {
261261
}
262262

263263

264-
private getMaximumHoverLength(configuration: vscode.WorkspaceConfiguration): number {
264+
private getMaximumHoverLength(document: vscode.TextDocument): number {
265265
const defaultMaxLength = 500;
266-
const maximumHoverLength = configuration.get<number>('maximumHoverLength', defaultMaxLength);
266+
const maximumHoverLength = vscode.workspace.getConfiguration('js/ts', document).get<number>('maximumHoverLength', defaultMaxLength);
267267
if (!Number.isSafeInteger(maximumHoverLength) || maximumHoverLength <= 0) {
268268
return defaultMaxLength;
269269
}

0 commit comments

Comments
 (0)