共用方式為


CSharpSyntaxTree.GetLineMappings(CancellationToken) Method

Definition

Returns empty sequence if there are no line mapping directives in the tree. Otherwise, returns a sequence of pairs of spans: each describing a mapping of a span of the tree between two consecutive #line directives. If the first directive is not on the first line the first pair describes mapping of the span preceding the first directive. The last pair of the sequence describes mapping of the span following the last #line directive.

public override System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.LineMapping> GetLineMappings (System.Threading.CancellationToken cancellationToken = default);
override this.GetLineMappings : System.Threading.CancellationToken -> seq<Microsoft.CodeAnalysis.LineMapping>
Public Overrides Function GetLineMappings (Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of LineMapping)

Parameters

cancellationToken
CancellationToken

Returns

Empty sequence if the tree does not contain a line mapping directive. Otherwise a non-empty sequence of LineMapping.

Applies to