Share via


SemanticModel.LookupLabels(Int32, String) 方法

定義

取得指定位置和選擇性容器內容中可用的具名標籤符號。 只會傳回可從指定位置存取且可見的成員。

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)

參數

position
Int32

用來判斷封入宣告範圍和協助工具的字元位置。

name
String

要尋找的符號名稱。 如果指定 null,則會傳回具有任何名稱的符號。

傳回

找到的符號清單。 如果找不到符號,則會傳回空的清單。

備註

「位置」可用來判斷哪些變數是可見且可存取的。 即使已指定 「container」 ,「位置」位置對於判斷可存取「包含」的成員很重要。

適用於