support useAliasesForRenames configuration

Closes #196
This commit is contained in:
Qiming Zhao 2020-08-21 23:19:45 +08:00
parent e4f3ab555b
commit 1a22372358
2 changed files with 13 additions and 1 deletions

View file

@ -298,6 +298,12 @@
"double"
]
},
"typescript.preferences.useAliasesForRenames": {
"type": "boolean",
"default": true,
"description": "Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace.",
"scope": "resource"
},
"typescript.suggestionActions.enabled": {
"type": "boolean",
"default": true,
@ -466,6 +472,12 @@
"double"
]
},
"javascript.preferences.useAliasesForRenames": {
"type": "boolean",
"default": true,
"description": "Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace.",
"scope": "resource"
},
"javascript.validate.enable": {
"type": "boolean",
"default": true,

View file

@ -154,7 +154,7 @@ export default class FileConfigurationManager {
importModuleSpecifierEnding: getImportModuleSpecifierEndingPreference(config),
allowTextChangesInNewFiles: uri.startsWith('file:'),
allowRenameOfImportPath: true,
providePrefixAndSuffixTextForRename: true,
providePrefixAndSuffixTextForRename: config.get<boolean>('renameShorthandProperties', true) === false ? false : config.get<boolean>('useAliasesForRenames', true),
}
return preferences
}