CxInspection

Description

abstract class Tinman.Core.Cx.Inspections.CxInspection

Represents an inspection that may be performed on PSI nodes.

An inspection is performed by calling the Check method. The given CxNode is inspected and zero or more messages are output to the specified Validator.

By failing, an inspection indicates that a problem exists which will have consequences as described by Flags. The name of an inspection is derived from its flags, for example: 'CX00001'.

Public / Constants

CX00001


[ShutdownSurvive]
public static readonly attribute CX00001 → (CxInspection)

[CX00001] bad code model: ...

The code model contains critical semantic errors:

  • …​invalid name
    A PSI node contains a CxId or CxName value that is invalid, see CxId.Invalid resp. CxName.Invalid. Invalid names cannot be parsed, so this problem may only occur when building a PSI model from code. Using invalid names in source code will trigger syntax errors.

CX00002


[ShutdownSurvive]
public static readonly attribute CX00002 → (CxInspection)

[CX00002] unresolved reference: ...

A PSI node that implements the ICxReference interface has not been resolved completely, i.e. IPsiNode.IsResolved returns false.

The code model must be modified in order to fix this, either by adding missing code parts or by repairing broken code references.

CX01001


[ShutdownSurvive]
public static readonly attribute CX01001 → (CxInspection)

[CX01001] missing native code: ...

No native code for CxStatementCode.LanguageCpp has been specified for the CxStatementCode.

CX02001


[ShutdownSurvive]
public static readonly attribute CX02001 → (CxInspection)

[CX02001] missing native code: ...

No native code for CxStatementCode.LanguageCs has been specified for the CxStatementCode.

CX03001


[ShutdownSurvive]
public static readonly attribute CX03001 → (CxInspection)

[CX03001] missing native code: ...

No native code for CxStatementCode.LanguageHlsl has been specified for the CxStatementCode.

CX04001


[ShutdownSurvive]
public static readonly attribute CX04001 → (CxInspection)

[CX04001] missing native code: ...

No native code for CxStatementCode.LanguageGlsl has been specified for the CxStatementCode.

Public / Methods

Check


[ThreadSafe]
public abstract method Check → (2)

node in : CxNode

[not-null]
The PSI node to check.

validator in : Validator

[not-null]
The validator to use for outputting messages.

returns → CxInspectionResult

The result of the inspection.

Performs this inspection on the given node in.

Public / Attributes

Flags


[Constant]
public attribute Flags → (get)

value : CxInspectionFlags

The inspection flags.

Returns the inspection flags.

Identifier


[Constant]
public attribute Identifier → (get)

value : int32

[1..511]
The inspection identifier.

Returns the inspection identifier.

Protected / Constructors

Cx​Inspection


protected constructor CxInspection → (2)

identifier in : int32

[1..511]
The value for Identifier.

flags in : CxInspectionFlags

The value for Flags.

Creates a new instance of CxInspection.

Protected / Methods

Message


protected method Message → (2)

node in : CxNode

[not-null]
The node for which the inspection has failed.

message in : string

[not-null]
The inspection message.

returns → ValidateMessage

The validation message.

Generates a validation message for a failed inspection.