From 0f0cc4f8168ee4bcca081b4d432c1ae466934756 Mon Sep 17 00:00:00 2001 From: joshuahs Date: Sun, 5 Apr 2020 14:47:28 -0400 Subject: [PATCH 1/3] Issue #93589: Rename 'renameShorthandProperties' setting to 'useAliasesForRenames' --- extensions/typescript-language-features/package.json | 8 ++++---- extensions/typescript-language-features/package.nls.json | 2 +- .../src/features/fileConfigurationManager.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index 0f37b279d8c58..39bb642e7392d 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -674,16 +674,16 @@ "description": "%typescript.preferences.importModuleSpecifierEnding%", "scope": "resource" }, - "javascript.preferences.renameShorthandProperties": { + "javascript.preferences.useAliasesForRenames": { "type": "boolean", "default": true, - "description": "%typescript.preferences.renameShorthandProperties%", + "description": "%typescript.preferences.useAliasesForRenames%", "scope": "resource" }, - "typescript.preferences.renameShorthandProperties": { + "typescript.preferences.useAliasesForRenames": { "type": "boolean", "default": true, - "description": "%typescript.preferences.renameShorthandProperties%", + "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 a2bf1f3eeed8a..93f4b3cac5309 100644 --- a/extensions/typescript-language-features/package.nls.json +++ b/extensions/typescript-language-features/package.nls.json @@ -99,7 +99,7 @@ "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.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 be7431eac9fa5..2d5eee4385200 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('useAliasesForRenames', true), allowRenameOfImportPath: true, }; From 8fb0397c67555b9ab7099ef4f6735a085a5afe65 Mon Sep 17 00:00:00 2001 From: joshuahs Date: Thu, 9 Apr 2020 01:17:45 -0400 Subject: [PATCH 2/3] Issue 93589: Added deprecation message to 'renameShorthandProperties' preference --- .../typescript-language-features/package.json | 14 ++++++++++++++ .../typescript-language-features/package.nls.json | 1 + 2 files changed, 15 insertions(+) diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index 39bb642e7392d..793f164be8c25 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -674,6 +674,20 @@ "description": "%typescript.preferences.importModuleSpecifierEnding%", "scope": "resource" }, + "javascript.preferences.renameShorthandProperties": { + "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, diff --git a/extensions/typescript-language-features/package.nls.json b/extensions/typescript-language-features/package.nls.json index 93f4b3cac5309..331d8d1face87 100644 --- a/extensions/typescript-language-features/package.nls.json +++ b/extensions/typescript-language-features/package.nls.json @@ -99,6 +99,7 @@ "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.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.", From 52372b1f93b4eab7be89ad9f5144e8625f0c155d Mon Sep 17 00:00:00 2001 From: joshuahs Date: Fri, 10 Apr 2020 23:31:11 -0400 Subject: [PATCH 3/3] Issue 93589: Old and new setting value added for mitigtion --- .../src/features/fileConfigurationManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/src/features/fileConfigurationManager.ts b/extensions/typescript-language-features/src/features/fileConfigurationManager.ts index 2d5eee4385200..13faefc545d5b 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('useAliasesForRenames', true), + providePrefixAndSuffixTextForRename: config.get('renameShorthandProperties', true) === false ? false : config.get('useAliasesForRenames', true), allowRenameOfImportPath: true, };