roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Remove the single-symbol assumption in ConflictResolver Session

Open Cosifne opened this issue 2 years ago • 0 comments

This PR is based on the renamer writer side change https://github.com/dotnet/roslyn/pull/62670 Since that PR is not checked in, I would put it in draft mode.


This is the second milestone to support renaming multiple symbols. The changes of this PR are

  1. Extract all the common code in conflict resolver session code to 'AbstractRenameSession', which doesn't assume there is only one symbol that gets renamed. All the existing rename functions, will call SingleSymbolRenameSession. It is done in this way because I feel overall our conflict-checking logic could be shared when renaming a single symbol or multiple symbols as stated here. However, we still utilize the assumption that 'we are only one symbol' to do some conflict checks like here All these scenarios would be handled in SingleSymbolRenameSession. Later a MultipleSymbolsRenameSession derived from 'AbstractRenameSession' could be added, which handles these situations differently.

  2. Classes like ConflictResolution, MutableConflictResolution and SymbolicRenameLocations are all based on the 'single symbol' assumption. This PR expands all of these implementations.


The next step of this PR, is to add MultipleSymbolsRenameSession, which handles the special conflict resolution logic for multiple symbols.

Cosifne avatar Aug 02 '22 22:08 Cosifne