Class Location
A program location in source code.
Inheritance
System.Object
Location
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Loretta.CodeAnalysis.dll
Syntax
public abstract class Location
Properties
|
Improve this Doc
View Source
IsInSource
Returns true if the location represents a specific location in a source code file.
Declaration
public bool IsInSource { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Kind
Location kind (None/SourceFile/MetadataFile).
Declaration
public abstract LocationKind Kind { get; }
Property Value
|
Improve this Doc
View Source
None
A location of kind LocationKind.None.
Declaration
public static Location None { get; }
Property Value
|
Improve this Doc
View Source
SourceSpan
The location within the syntax tree that this location is associated with.
Declaration
public virtual TextSpan SourceSpan { get; }
Property Value
|
Improve this Doc
View Source
SourceTree
The syntax tree this location is located in or null
if not in a syntax tree.
Declaration
public virtual SyntaxTree SourceTree { get; }
Property Value
Methods
|
Improve this Doc
View Source
Create(SyntaxTree, TextSpan)
Declaration
public static Location Create(SyntaxTree syntaxTree, TextSpan textSpan)
Parameters
Returns
|
Improve this Doc
View Source
Create(String, TextSpan, LinePositionSpan)
Creates an instance of a Location for a span in a file.
Declaration
public static Location Create(string filePath, TextSpan textSpan, LinePositionSpan lineSpan)
Parameters
Returns
|
Improve this Doc
View Source
Equals(Object)
Declaration
public abstract override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
GetDebuggerDisplay()
Returns the display string for the debugger.
Declaration
protected virtual string GetDebuggerDisplay()
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetHashCode()
Declaration
public abstract override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
GetLineSpan()
Gets the location in terms of path, line and column.
Declaration
public virtual FileLinePositionSpan GetLineSpan()
Returns
Type |
Description |
FileLinePositionSpan |
FileLinePositionSpan that contains path, line and column information.
Returns an invalid span (see IsValid) if the information is not available.
The values are not affected by line mapping directives (#line in C# or #ExternalSource in VB).
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
Operators
|
Improve this Doc
View Source
Equality(Location, Location)
Checks whether two locations are equal.
Declaration
public static bool operator ==(Location left, Location right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Inequality(Location, Location)
Checks whether two locations are not equal.
Declaration
public static bool operator !=(Location left, Location right)
Parameters
Returns
Type |
Description |
System.Boolean |
|