refactor config path

This commit is contained in:
Gabriela Araujo Britto
2025-05-07 11:31:47 -07:00
parent c2822f848d
commit 56e2f3c5c4
3 changed files with 7 additions and 13 deletions

View File

@@ -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;
}