diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index 20513acc2d5..6ccd89f70e1 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -678,12 +678,26 @@ "type": "boolean", "default": true, "description": "%typescript.preferences.renameShorthandProperties%", + "deprecationMessage": "%typescript.preferences.renameShorthandProperties.deprecationMessage%", "scope": "resource" }, "typescript.preferences.renameShorthandProperties": { "type": "boolean", "default": true, "description": "%typescript.preferences.renameShorthandProperties%", + "deprecationMessage": "%typescript.preferences.renameShorthandProperties.deprecationMessage%", + "scope": "resource" + }, + "javascript.preferences.useAliasesForRenames": { + "type": "boolean", + "default": true, + "description": "%typescript.preferences.useAliasesForRenames%", + "scope": "resource" + }, + "typescript.preferences.useAliasesForRenames": { + "type": "boolean", + "default": true, + "description": "%typescript.preferences.useAliasesForRenames%", "scope": "resource" }, "typescript.updateImportsOnFileMove.enabled": { diff --git a/extensions/typescript-language-features/package.nls.json b/extensions/typescript-language-features/package.nls.json index a2bf1f3eeed..331d8d1face 100644 --- a/extensions/typescript-language-features/package.nls.json +++ b/extensions/typescript-language-features/package.nls.json @@ -99,7 +99,8 @@ "configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval": "Check every file for changes several times a second, but use heuristics to check certain types of files less frequently than others.", "configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling ": "Use a dynamic queue where less-frequently modified files will be checked less often.", "configuration.tsserver.watchOptions.synchronousWatchDirectory": "Disable deferred watching on directories. Deferred watching is useful when lots of file changes might occur at once (e.g. a change in node_modules from running npm install), but you might want to disable it with this flag for some less-common setups.", - "typescript.preferences.renameShorthandProperties": "Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace.", + "typescript.preferences.renameShorthandProperties.deprecationMessage": "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", + "typescript.preferences.useAliasesForRenames": "Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace.", "codeActions.refactor.extract.constant.title": "Extract constant", "codeActions.refactor.extract.constant.description": "Extract expression to constant.", "codeActions.refactor.extract.function.title": "Extract function", diff --git a/extensions/typescript-language-features/src/features/fileConfigurationManager.ts b/extensions/typescript-language-features/src/features/fileConfigurationManager.ts index be7431eac9f..13faefc545d 100644 --- a/extensions/typescript-language-features/src/features/fileConfigurationManager.ts +++ b/extensions/typescript-language-features/src/features/fileConfigurationManager.ts @@ -186,7 +186,7 @@ export default class FileConfigurationManager extends Disposable { importModuleSpecifierPreference: getImportModuleSpecifierPreference(config), importModuleSpecifierEnding: getImportModuleSpecifierEndingPreference(config), allowTextChangesInNewFiles: document.uri.scheme === fileSchemes.file, - providePrefixAndSuffixTextForRename: config.get('renameShorthandProperties', true), + providePrefixAndSuffixTextForRename: config.get('renameShorthandProperties', true) === false ? false : config.get('useAliasesForRenames', true), allowRenameOfImportPath: true, };