Class SyntaxAnnotation
A SyntaxAnnotation is used to annotate syntax elements with additional information.
Since syntax elements are immutable, annotating them requires creating new instances of them with the annotations attached.
Inheritance
System.Object
SyntaxAnnotation
Implements
IEquatable<SyntaxAnnotation>
Namespace: Loretta.CodeAnalysis
Assembly: Loretta.CodeAnalysis.dll
Syntax
public sealed class SyntaxAnnotation : IObjectWritable
Constructors
| Improve this Doc View SourceSyntaxAnnotation()
Creates a new empty annotation.
Declaration
public SyntaxAnnotation()
SyntaxAnnotation(String)
Creates a new annotation without a value.
Declaration
public SyntaxAnnotation(string kind)
Parameters
Type | Name | Description |
---|---|---|
System.String | kind |
SyntaxAnnotation(String, String)
Creates a new annotation.
Declaration
public SyntaxAnnotation(string kind, string data)
Parameters
Type | Name | Description |
---|---|---|
System.String | kind | |
System.String | data |
Properties
| Improve this Doc View SourceData
The annotation's data.
Declaration
public string Data { get; }
Property Value
Type | Description |
---|---|
System.String |
ElasticAnnotation
A predefined syntax annotation that indicates whether the syntax element has elastic trivia.
Declaration
public static SyntaxAnnotation ElasticAnnotation { get; }
Property Value
Type | Description |
---|---|
SyntaxAnnotation |
Kind
The kind of annotation.
Declaration
public string Kind { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceEquals(SyntaxAnnotation)
Declaration
public bool Equals(SyntaxAnnotation other)
Parameters
Type | Name | Description |
---|---|---|
SyntaxAnnotation | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Operators
| Improve this Doc View SourceEquality(SyntaxAnnotation, SyntaxAnnotation)
Checks whether two annotations are equal.
Declaration
public static bool operator ==(SyntaxAnnotation left, SyntaxAnnotation right)
Parameters
Type | Name | Description |
---|---|---|
SyntaxAnnotation | left | |
SyntaxAnnotation | right |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(SyntaxAnnotation, SyntaxAnnotation)
Checks whether two annotations are not equal.
Declaration
public static bool operator !=(SyntaxAnnotation left, SyntaxAnnotation right)
Parameters
Type | Name | Description |
---|---|---|
SyntaxAnnotation | left | |
SyntaxAnnotation | right |
Returns
Type | Description |
---|---|
System.Boolean |
Implements
IEquatable<>