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 || '') }) } }