mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 16:18:58 +01:00
Merge pull request #209293 from iisaduan/organize-imports-settings
add settings for typescript's organizeImports to the settings interface
This commit is contained in:
@@ -199,6 +199,7 @@ export default class FileConfigurationManager extends Disposable {
|
||||
interactiveInlayHints: true,
|
||||
includeCompletionsForModuleExports: config.get<boolean>('suggest.autoImports'),
|
||||
...getInlayHintsPreferences(config),
|
||||
...this.getOrganizeImportsPreferences(config),
|
||||
};
|
||||
|
||||
return preferences;
|
||||
@@ -227,6 +228,23 @@ export default class FileConfigurationManager extends Disposable {
|
||||
wildcardPrefix + '**' + path.sep + p;
|
||||
});
|
||||
}
|
||||
|
||||
private getOrganizeImportsPreferences(config: vscode.WorkspaceConfiguration): Proto.UserPreferences {
|
||||
return {
|
||||
// More specific settings
|
||||
organizeImportsAccentCollation: config.get<boolean>('organizeImports.accentCollation'),
|
||||
organizeImportsCaseFirst: withDefaultAsUndefined(config.get<'default' | 'upper' | 'lower'>('organizeImports.caseFirst', 'default'), 'default'),
|
||||
organizeImportsCollation: config.get<'ordinal' | 'unicode'>('organizeImports.collation'),
|
||||
organizeImportsIgnoreCase: withDefaultAsUndefined(config.get<'auto' | 'caseInsensitive' | 'caseSensitive'>('organizeImports.caseSensitivity'), 'auto'),
|
||||
organizeImportsLocale: config.get<string>('organizeImports.locale'),
|
||||
organizeImportsNumericCollation: config.get<boolean>('organizeImports.numericCollation'),
|
||||
organizeImportsTypeOrder: withDefaultAsUndefined(config.get<'auto' | 'last' | 'inline' | 'first'>('organizeImports.typeOrder', 'auto'), 'auto'),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function withDefaultAsUndefined<T, O extends T>(value: T, def: O): Exclude<T, O> | undefined {
|
||||
return value === def ? undefined : value as Exclude<T, O>;
|
||||
}
|
||||
|
||||
export class InlayHintSettingNames {
|
||||
|
||||
Reference in New Issue
Block a user