fix rename feature (#86)

* fix rename feature

* Update fileConfigurationManager.ts
This commit is contained in:
gavrilyak 2019-10-31 03:33:49 +02:00 committed by Qiming zhao
parent a22270bede
commit aef36c8345
2 changed files with 2 additions and 1 deletions

View file

@ -146,6 +146,7 @@ export default class FileConfigurationManager {
quotePreference: config.get<'single' | 'double' | 'auto'>('preferences.quoteStyle', defaultQuote), quotePreference: config.get<'single' | 'double' | 'auto'>('preferences.quoteStyle', defaultQuote),
allowRenameOfImportPath: true, allowRenameOfImportPath: true,
allowTextChangesInNewFiles: true, allowTextChangesInNewFiles: true,
providePrefixAndSuffixTextForRename: true,
} }
} }
} }

View file

@ -98,7 +98,7 @@ export default class TypeScriptRenameProvider implements RenameProvider {
for (const textSpan of spanGroup.locs) { for (const textSpan of spanGroup.locs) {
changes[uri].push({ changes[uri].push({
range: typeConverters.Range.fromTextSpan(textSpan), range: typeConverters.Range.fromTextSpan(textSpan),
newText: newName newText: (textSpan.prefixText || '') + newName + (textSpan.suffixText || '')
}) })
} }
} }