mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
add maximum hover length
This commit is contained in:
@@ -208,6 +208,8 @@ export default class FileConfigurationManager extends Disposable {
|
||||
includeCompletionsForModuleExports: config.get<boolean>('suggest.autoImports'),
|
||||
...getInlayHintsPreferences(config),
|
||||
...this.getOrganizeImportsPreferences(preferencesConfig),
|
||||
// @ts-expect-error until TS 5.9
|
||||
maximumHoverLength: this.getMaximumHoverLength(config),
|
||||
};
|
||||
|
||||
return preferences;
|
||||
@@ -257,6 +259,16 @@ export default class FileConfigurationManager extends Disposable {
|
||||
} : {}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private getMaximumHoverLength(configuration: vscode.WorkspaceConfiguration): number {
|
||||
const defaultMaxLength = 500;
|
||||
const maximumHoverLength = configuration.get<number>('maximumHoverLength', defaultMaxLength);
|
||||
if (!Number.isSafeInteger(maximumHoverLength) || maximumHoverLength <= 0) {
|
||||
return defaultMaxLength;
|
||||
}
|
||||
return maximumHoverLength;
|
||||
}
|
||||
}
|
||||
|
||||
function withDefaultAsUndefined<T, O extends T>(value: T, def: O): Exclude<T, O> | undefined {
|
||||
|
||||
Reference in New Issue
Block a user