mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
refactor config path
This commit is contained in:
@@ -481,17 +481,11 @@
|
||||
"experimental"
|
||||
]
|
||||
},
|
||||
"typescript.maximumHoverLength": {
|
||||
"js/ts.hover.maximumLength": {
|
||||
"type": "number",
|
||||
"default": 500,
|
||||
"description": "%configuration.maximumHoverLength%",
|
||||
"scope": "window"
|
||||
},
|
||||
"javascript.maximumHoverLength": {
|
||||
"type": "number",
|
||||
"default": 500,
|
||||
"description": "%configuration.maximumHoverLength%",
|
||||
"scope": "window"
|
||||
"description": "%configuration.hover.maximumLength%",
|
||||
"scope": "resource"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
"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.",
|
||||
"configuration.updateImportsOnPaste": "Automatically update imports when pasting code. Requires TypeScript 5.6+.",
|
||||
"configuration.expandableHover": "Enable expanding/contracting the hover to reveal more/less information from the TS server. Requires TypeScript 5.9+.",
|
||||
"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+.",
|
||||
"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+.",
|
||||
"walkthroughs.nodejsWelcome.title": "Get started with JavaScript and Node.js",
|
||||
"walkthroughs.nodejsWelcome.description": "Make the most of Visual Studio Code's first-class JavaScript experience.",
|
||||
"walkthroughs.nodejsWelcome.downloadNode.forMacOrWindows.title": "Install Node.js",
|
||||
|
||||
@@ -209,7 +209,7 @@ export default class FileConfigurationManager extends Disposable {
|
||||
...getInlayHintsPreferences(config),
|
||||
...this.getOrganizeImportsPreferences(preferencesConfig),
|
||||
// @ts-expect-error until TS 5.9
|
||||
maximumHoverLength: this.getMaximumHoverLength(config),
|
||||
maximumHoverLength: this.getMaximumHoverLength(document),
|
||||
};
|
||||
|
||||
return preferences;
|
||||
@@ -261,9 +261,9 @@ export default class FileConfigurationManager extends Disposable {
|
||||
}
|
||||
|
||||
|
||||
private getMaximumHoverLength(configuration: vscode.WorkspaceConfiguration): number {
|
||||
private getMaximumHoverLength(document: vscode.TextDocument): number {
|
||||
const defaultMaxLength = 500;
|
||||
const maximumHoverLength = configuration.get<number>('maximumHoverLength', defaultMaxLength);
|
||||
const maximumHoverLength = vscode.workspace.getConfiguration('js/ts', document).get<number>('maximumHoverLength', defaultMaxLength);
|
||||
if (!Number.isSafeInteger(maximumHoverLength) || maximumHoverLength <= 0) {
|
||||
return defaultMaxLength;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user