C# Class Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver

Exibir arquivo Open project: lodejard/AllNetCore

Public Methods

Method Description
CreateDeclarationLocationAnnotationsAsync ( Solution solution, IEnumerable symbols, CancellationToken cancellationToken ) : Task
ResolveConflictsAsync ( RenameLocations renameLocationSet, string originalText, string replacementText, OptionSet optionSet, Func hasConflict, CancellationToken cancellationToken ) : Task

Performs the renaming of the symbol in the solution, identifies renaming conflicts and automatically resolves them where possible.

Private Methods

Method Description
AddConflictingParametersOfProperties ( IEnumerable properties, string newPropertyName, List conflicts ) : void
AddConflictingSymbolLocations ( IEnumerable conflictingSymbols, Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolution conflictResolution, IDictionary reverseMappedLocations ) : void
AddDeclarationConflictsAsync ( ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable referencedSymbols, Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolution conflictResolution, IDictionary reverseMappedLocations, CancellationToken cancellationToken ) : Task

Computes an adds conflicts relating to declarations, which are independent of location-based checks. Examples of these types of conflicts include renaming a member to the same name as another member of a type: binding doesn't change (at least from the perspective of find all references), but we still need to track it.

AddImplicitConflictsAsync ( ISymbol renamedSymbol, ISymbol originalSymbol, IEnumerable implicitReferenceLocations, SemanticModel semanticModel, Location originalDeclarationLocation, int newDeclarationLocationStartingPosition, Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolution conflictResolution, CancellationToken cancellationToken ) : Task
GetExpansionTargetForLocationPerLanguage ( SyntaxToken tokenOrNode, Document document ) : SyntaxNode
GetString ( ISymbol symbol ) : string
GetSymbolLocationAsync ( Solution solution, ISymbol symbol, CancellationToken cancellationToken ) : Task

Gives the First Location for a given Symbol by ordering the locations using DocumentId first and Location starting position second

HeuristicMetadataNameEquivalenceCheck ( string oldMetadataName, string newMetadataName, string originalText, string replacementText ) : bool
IsIdentifierSeparator ( char element ) : bool
IsIdentifierValid_Worker ( Solution solution, string replacementText, IEnumerable projectIds, CancellationToken cancellationToken ) : bool
IsRenameValid ( Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolution conflictResolution, ISymbol renamedSymbol ) : bool
IsSubStringEqual ( string str1, string str2, int index ) : bool
IsWholeIdentifier ( string metadataName, string searchText, int index ) : bool
LocalVariableConflictPerLanguage ( SyntaxToken tokenOrNode, Document document, IEnumerable newReferencedSymbols ) : bool
SymbolsForEnclosingInvocationExpressionWorker ( SyntaxNode invocationExpression, SemanticModel semanticModel, CancellationToken cancellationToken ) : IEnumerable

Used to find the symbols associated with the Invocation Expression surrounding the Token

Method Details

CreateDeclarationLocationAnnotationsAsync() public static method

public static CreateDeclarationLocationAnnotationsAsync ( Solution solution, IEnumerable symbols, CancellationToken cancellationToken ) : Task
solution Solution
symbols IEnumerable
cancellationToken CancellationToken
return Task

ResolveConflictsAsync() public static method

Performs the renaming of the symbol in the solution, identifies renaming conflicts and automatically resolves them where possible.
public static ResolveConflictsAsync ( RenameLocations renameLocationSet, string originalText, string replacementText, OptionSet optionSet, Func hasConflict, CancellationToken cancellationToken ) : Task
renameLocationSet RenameLocations The locations to perform the renaming at.
originalText string The original name of the identifier.
replacementText string The new name of the identifier
optionSet OptionSet The option for rename
hasConflict Func Called after renaming references. Can be used by callers to /// indicate if the new symbols that the reference binds to should be considered to be ok or /// are in conflict. 'true' means they are conflicts. 'false' means they are not conflicts. /// 'null' means that the default conflict check should be used.
cancellationToken CancellationToken The cancellation token.
return Task