Delen via


Location Class

Definition

A program location in source code.

public ref class Location abstract
[System.Diagnostics.DebuggerDisplay("{GetDebuggerDisplay(), nq}")]
public abstract class Location
[<System.Diagnostics.DebuggerDisplay("{GetDebuggerDisplay(), nq}")>]
type Location = class
Public MustInherit Class Location
Inheritance
Location
Attributes

Properties

IsInMetadata

Returns true if the location is in metadata.

IsInSource

Returns true if the location represents a specific location in a source code file.

Kind

Location kind (None/SourceFile/MetadataFile).

MetadataModule

Returns the metadata module the location is associated with or null if the module is not available.

None

A location of kind LocationKind.None.

SourceSpan

The location within the syntax tree that this location is associated with.

SourceTree

The syntax tree this location is located in or null if not in a syntax tree.

Methods

Create(String, TextSpan, LinePositionSpan, String, LinePositionSpan)

Creates an instance of a Location for a span in a file with a mapped file and span.

Create(String, TextSpan, LinePositionSpan)

Creates an instance of a Location for a span in a file.

Create(SyntaxTree, TextSpan)

Creates an instance of a Location for a span in a SyntaxTree.

Equals(Object)
GetDebuggerDisplay()
GetHashCode()
GetLineSpan()

Gets the location in terms of path, line and column.

GetMappedLineSpan()

Gets the location in terms of path, line and column after applying source line mapping directives (#line in C# or #ExternalSource in VB).

ToString()

Operators

Equality(Location, Location)
Inequality(Location, Location)

Applies to