C# Класс 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).
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

FindLocalReferences() публичный Метод

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.
Результат void

FindReferencesInFile() публичный Метод

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.
Результат void

FindReferencesInFile() публичный Метод

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.
Результат void

FindReferencesInFile() публичный Метод

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.
Результат void

FindReferencesInFile() публичный Метод

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.
Результат void

GetEffectiveAccessibility() публичный статический Метод

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
Результат Accessibility

GetInterestingFiles() публичный Метод

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
Результат IEnumerable

GetNodeToReplace() публичный статический Метод

public static GetNodeToReplace ( AstNode node ) : AstNode
node AstNode
Результат AstNode

GetSearchScopes() публичный Метод

public GetSearchScopes ( IEnumerable symbols ) : IList
symbols IEnumerable
Результат IList

GetSearchScopes() публичный Метод

public GetSearchScopes ( ISymbol symbol ) : IList
symbol ISymbol
Результат IList

RenameReferencesInFile() публичный Метод

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
Результат void