Add setting for preferring type-only imports (#196123)

This commit is contained in:
Andrew Branch 2023-10-30 13:14:58 -05:00 committed by GitHub
parent 8905246ad4
commit 82ece597ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -1067,6 +1067,12 @@
"markdownDescription": "%typescript.preferences.autoImportFileExcludePatterns%",
"scope": "resource"
},
"typescript.preferences.preferTypeOnlyAutoImports": {
"type": "boolean",
"default": false,
"markdownDescription": "%typescript.preferences.preferTypeOnlyAutoImports%",
"scope": "resource"
},
"javascript.preferences.renameShorthandProperties": {
"type": "boolean",
"default": true,

View file

@ -191,6 +191,8 @@ export default class FileConfigurationManager extends Disposable {
includeCompletionsWithClassMemberSnippets: config.get<boolean>('suggest.classMemberSnippets.enabled', true),
includeCompletionsWithObjectLiteralMethodSnippets: config.get<boolean>('suggest.objectLiteralMethodSnippets.enabled', true),
autoImportFileExcludePatterns: this.getAutoImportFileExcludePatternsPreference(preferencesConfig, vscode.workspace.getWorkspaceFolder(document.uri)?.uri),
// @ts-expect-error until 5.3 #56090
preferTypeOnlyAutoImports: config.get<boolean>('preferTypeOnlyAutoImports', false),
useLabelDetailsInCompletionEntries: true,
allowIncompleteCompletions: true,
displayPartsForJSDoc: true,