Skip to content

Commit

Permalink
Issue #93589: Rename 'renameShorthandProperties' setting to 'useAlias…
Browse files Browse the repository at this point in the history
…esForRenames' (#94480)

* Issue #93589: Rename 'renameShorthandProperties' setting to 'useAliasesForRenames'

* Issue 93589: Added deprecation message to 'renameShorthandProperties' preference

* Issue 93589: Old and new setting value added for mitigtion

Co-authored-by: joshuahs <joshuahs@umich.edu>
  • Loading branch information
swiz115 and joshuahs committed Apr 14, 2020
1 parent 1d10fe1 commit 3f9e684
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions extensions/typescript-language-features/package.json
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion extensions/typescript-language-features/package.nls.json
Expand Up @@ -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",
Expand Down
Expand Up @@ -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<boolean>('renameShorthandProperties', true),
providePrefixAndSuffixTextForRename: config.get<boolean>('renameShorthandProperties', true) === false ? false : config.get<boolean>('useAliasesForRenames', true),
allowRenameOfImportPath: true,
};

Expand Down

0 comments on commit 3f9e684

Please sign in to comment.