Freigeben über


SemanticModel.LookupLabels(Int32, String) Method

Definition

Gets the available named label symbols in the context of the specified location and optional container. Only members that are accessible and visible from the given location are returned.

public System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol> LookupLabels (int position, string name = default);
public System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol> LookupLabels (int position, string? name = default);
member this.LookupLabels : int * string -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol>
Public Function LookupLabels (position As Integer, Optional name As String = Nothing) As ImmutableArray(Of ISymbol)

Parameters

position
Int32

The character position for determining the enclosing declaration scope and accessibility.

name
String

The name of the symbol to find. If null is specified then symbols with any names are returned.

Returns

A list of symbols that were found. If no symbols were found, an empty list is returned.

Remarks

The "position" is used to determine what variables are visible and accessible. Even if "container" is specified, the "position" location is significant for determining which members of "containing" are accessible.

Applies to