C# Class ICSharpCode.NRefactory.CSharp.Resolver.FindReferences

'Find references' implementation.
This class is thread-safe. The intended multi-threaded usage is to call GetSearchScopes() once, and then call FindReferencesInFile() concurrently on multiple threads (parallel foreach over all interesting files).
Afficher le fichier Open project: 0xd4d/NRefactory Class Usage Examples

Méthodes publiques

Méthode Description
FindLocalReferences ( IVariable variable, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void

Finds all references of a given variable.

FindReferencesInFile ( IFindReferenceSearchScope searchScope, ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void

Finds all references in the given file.

FindReferencesInFile ( IFindReferenceSearchScope searchScope, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void

Finds all references in the given file.

FindReferencesInFile ( IList searchScopes, ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void

Finds all references in the given file.

FindReferencesInFile ( IList searchScopes, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void

Finds all references in the given file.

GetEffectiveAccessibility ( IEntity entity ) : Accessibility

Gets the effective accessibility of the specified entity - that is, the accessibility viewed from the top level.

internal member in public class -> internal public member in internal class -> internal protected member in public class -> protected protected member in internal class -> protected and internal

GetInterestingFiles ( IFindReferenceSearchScope searchScope, ICompilation compilation ) : IEnumerable

Gets the file names that possibly contain references to the element being searched for.

GetNodeToReplace ( AstNode node ) : AstNode
GetSearchScopes ( IEnumerable symbols ) : IList
GetSearchScopes ( ISymbol symbol ) : IList
RenameReferencesInFile ( IList searchScopes, string newName, ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, Action callback, Action errorCallback, CancellationToken cancellationToken = default(CancellationToken) ) : void

Private Methods

Méthode Description
FindAwaiterIsCompletedReferences ( IProperty property ) : SearchScope
FindBinaryOperator ( IMethod op, BinaryOperatorType operatorType ) : SearchScope
FindChainedConstructorReferences ( IMethod ctor ) : SearchScope
FindEnumeratorCurrentReferences ( IProperty property ) : SearchScope
FindIndexerReferences ( IProperty indexer ) : SearchScope
FindMemberReferences ( IEntity member, FindMemberReferencesNavigator>.Func factory ) : SearchScope
FindObjectCreateReferences ( IMethod ctor ) : SearchScope
FindOperator ( IMethod op, FindReferenceNavigator>.Func factory ) : SearchScope
FindTypeDefinitionReferences ( ITypeDefinition typeDefinition, bool findTypeReferencesEvenIfAliased, SearchScope &additionalScope ) : SearchScope
FindTypeDefinitionReferences ( ITypeDefinition typeDefinition, string searchTerm ) : SearchScope
FindTypeParameterReferences ( IType typeParameter, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void
FindUnaryOperator ( IMethod op, UnaryOperatorType operatorType ) : SearchScope
GetInterestingFilesProtected ( ITypeDefinition referencedTypeDefinition ) : IEnumerable
GetSearchScopeForDestructor ( IMethod dtor ) : SearchScope
GetSearchScopeForLocalVariable ( IVariable variable ) : SearchScope
GetSearchScopeForMethod ( IMethod method ) : SearchScope
GetSearchScopeForNamespace ( INamespace ns ) : SearchScope
GetSearchScopeForOperator ( IMethod op ) : SearchScope
GetSearchScopeForParameter ( IParameter parameter ) : SearchScope
GetSearchScopeForTypeParameter ( ITypeParameter tp ) : SearchScope
GetTopLevelTypeDefinition ( IEntity entity ) : ITypeDefinition
IsMemberMatch ( IMember member, IMember referencedMember, bool isVirtualCall ) : bool
MergeAccessibility ( Accessibility outer, Accessibility inner ) : Accessibility
NormalizeMember ( IMember member ) : IMember

Method Details

FindLocalReferences() public méthode

Finds all references of a given variable.
public FindLocalReferences ( IVariable variable, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void
variable IVariable The variable for which to look.
unresolvedFile CSharpUnresolvedFile The type system representation of the file being searched.
syntaxTree SyntaxTree The syntax tree of the file being searched.
compilation ICompilation The compilation.
callback FoundReferenceCallback Callback used to report the references that were found.
cancellationToken System.Threading.CancellationToken Cancellation token that may be used to cancel the operation.
Résultat void

FindReferencesInFile() public méthode

Finds all references in the given file.
public FindReferencesInFile ( IFindReferenceSearchScope searchScope, ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void
searchScope IFindReferenceSearchScope The search scope for which to look.
resolver ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver AST resolver for the file to search in.
callback FoundReferenceCallback Callback used to report the references that were found.
cancellationToken System.Threading.CancellationToken CancellationToken that may be used to cancel the operation.
Résultat void

FindReferencesInFile() public méthode

Finds all references in the given file.
public FindReferencesInFile ( IFindReferenceSearchScope searchScope, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void
searchScope IFindReferenceSearchScope The search scope for which to look.
unresolvedFile CSharpUnresolvedFile The type system representation of the file being searched.
syntaxTree SyntaxTree The syntax tree of the file being searched.
compilation ICompilation The compilation for the project that contains the file.
callback FoundReferenceCallback Callback used to report the references that were found.
cancellationToken System.Threading.CancellationToken CancellationToken that may be used to cancel the operation.
Résultat void

FindReferencesInFile() public méthode

Finds all references in the given file.
public FindReferencesInFile ( IList searchScopes, ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void
searchScopes IList The search scopes for which to look.
resolver ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver AST resolver for the file to search in.
callback FoundReferenceCallback Callback used to report the references that were found.
cancellationToken System.Threading.CancellationToken CancellationToken that may be used to cancel the operation.
Résultat void

FindReferencesInFile() public méthode

Finds all references in the given file.
public FindReferencesInFile ( IList searchScopes, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken ) : void
searchScopes IList The search scopes for which to look.
unresolvedFile CSharpUnresolvedFile The type system representation of the file being searched.
syntaxTree SyntaxTree The syntax tree of the file being searched.
compilation ICompilation The compilation for the project that contains the file.
callback FoundReferenceCallback Callback used to report the references that were found.
cancellationToken System.Threading.CancellationToken CancellationToken that may be used to cancel the operation.
Résultat void

GetEffectiveAccessibility() public static méthode

Gets the effective accessibility of the specified entity - that is, the accessibility viewed from the top level.
internal member in public class -> internal public member in internal class -> internal protected member in public class -> protected protected member in internal class -> protected and internal
public static GetEffectiveAccessibility ( IEntity entity ) : Accessibility
entity IEntity
Résultat Accessibility

GetInterestingFiles() public méthode

Gets the file names that possibly contain references to the element being searched for.
public GetInterestingFiles ( IFindReferenceSearchScope searchScope, ICompilation compilation ) : IEnumerable
searchScope IFindReferenceSearchScope
compilation ICompilation
Résultat IEnumerable

GetNodeToReplace() public static méthode

public static GetNodeToReplace ( AstNode node ) : AstNode
node AstNode
Résultat AstNode

GetSearchScopes() public méthode

public GetSearchScopes ( IEnumerable symbols ) : IList
symbols IEnumerable
Résultat IList

GetSearchScopes() public méthode

public GetSearchScopes ( ISymbol symbol ) : IList
symbol ISymbol
Résultat IList

RenameReferencesInFile() public méthode

public RenameReferencesInFile ( IList searchScopes, string newName, ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, Action callback, Action errorCallback, CancellationToken cancellationToken = default(CancellationToken) ) : void
searchScopes IList
newName string
resolver ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver
callback Action
errorCallback Action
cancellationToken System.Threading.CancellationToken
Résultat void