From aef36c8345fe8c587281c463bb0792d60dce305f Mon Sep 17 00:00:00 2001 From: gavrilyak Date: Thu, 31 Oct 2019 03:33:49 +0200 Subject: [PATCH] fix rename feature (#86) * fix rename feature * Update fileConfigurationManager.ts --- src/server/features/fileConfigurationManager.ts | 1 + src/server/features/rename.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/features/fileConfigurationManager.ts b/src/server/features/fileConfigurationManager.ts index f0cb7ee..e1c788f 100644 --- a/src/server/features/fileConfigurationManager.ts +++ b/src/server/features/fileConfigurationManager.ts @@ -146,6 +146,7 @@ export default class FileConfigurationManager { quotePreference: config.get<'single' | 'double' | 'auto'>('preferences.quoteStyle', defaultQuote), allowRenameOfImportPath: true, allowTextChangesInNewFiles: true, + providePrefixAndSuffixTextForRename: true, } } } diff --git a/src/server/features/rename.ts b/src/server/features/rename.ts index 02c3e8f..0c50e03 100644 --- a/src/server/features/rename.ts +++ b/src/server/features/rename.ts @@ -98,7 +98,7 @@ export default class TypeScriptRenameProvider implements RenameProvider { for (const textSpan of spanGroup.locs) { changes[uri].push({ range: typeConverters.Range.fromTextSpan(textSpan), - newText: newName + newText: (textSpan.prefixText || '') + newName + (textSpan.suffixText || '') }) } }