Interface IDiagnostic

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type IDiagnostic = interface(IInterface)

Description

A single diagnostic, containing the diagnostic's severity, location, text, source ranges, and fix-it hints.

Attributes
GUID['{41A68BA7-543A-49DB-A7E0-636798B2D923}']

Hierarchy

  • IInterface
  • IDiagnostic

Overview

Methods

Public function GetChildDiagnostics: IDiagnosticSet;
Public function GetSeverity: TDiagnosticSeverity;
Public function GetLocation: TSourceLocation;
Public function GetSpelling: String;
Public function GetEnableOption: String;
Public function GetDisableOption: String;
Public function GetCategory: Integer;
Public function GetCategoryText: String;
Public function GetRangeCount: Integer;
Public function GetRange(const AIndex: Integer): TSourceRange;
Public function GetFixItCount: Integer;
Public function GetHandle: TCXDiagnostic;
Public function Format(const AOptions: TDiagnosticDisplayOptions): String;
Public function FixIt(const AFixItIndex: Integer; out AReplacementRange: TSourceRange): String;

Properties

Public property ChildDiagnostics: IDiagnosticSet read GetChildDiagnostics;
Public property Severity: TDiagnosticSeverity read GetSeverity;
Public property Location: TSourceLocation read GetLocation;
Public property Spelling: String read GetSpelling;
Public property EnableOption: String read GetEnableOption;
Public property DisableOption: String read GetDisableOption;
Public property Category: Integer read GetCategory;
Public property CategoryText: String read GetCategoryText;
Public property RangeCount: Integer read GetRangeCount;
Public property Ranges[constAIndex:Integer]: TSourceRange read GetRange;
Public property FixItCount: Integer read GetFixItCount;
Public property Handle: TCXDiagnostic read GetHandle;

Description

Methods

Public function GetChildDiagnostics: IDiagnosticSet;
 
Public function GetSeverity: TDiagnosticSeverity;
 
Public function GetLocation: TSourceLocation;
 
Public function GetSpelling: String;
 
Public function GetEnableOption: String;
 
Public function GetDisableOption: String;
 
Public function GetCategory: Integer;
 
Public function GetCategoryText: String;
 
Public function GetRangeCount: Integer;
 
Public function GetRange(const AIndex: Integer): TSourceRange;
 
Public function GetFixItCount: Integer;
 
Public function GetHandle: TCXDiagnostic;
 
Public function Format(const AOptions: TDiagnosticDisplayOptions): String;

Format the diagnostic in a manner that is suitable for display.

This routine will format the diagnostic to a string, renderingthe diagnostic according to the various options given. The GetDefaultDiagnosticDisplayOptions function returns the set of options that most closely mimics the behavior of the clang compiler.

Parameters
AOptions
a set of options that control the diagnostic display.
Returns

The formatted diagnostic.

Public function FixIt(const AFixItIndex: Integer; out AReplacementRange: TSourceRange): String;

Retrieve the replacement information for a given fix-it.

Fix-its are described in terms of a source range whose contents should be replaced by a string. This approach generalizes over three kinds of operations: removal of source code (the range covers the code to be removed and the replacement string is empty), replacement of source code (the range covers the code to be replaced and the replacement string provides the new code), and insertion (both the start and end of the range point at the insertion location, and the replacement string provides the text to insert).

Parameters
AFixItIndex
the zero-based index of the fix-it (0..FixItCount-1).
AReplacementRange
is set to the source range whose contents should be replaced with the returned replacement string. Note that source ranges are half-open ranges [a, b), so the source code should be replaced from a and up to (but not including) b.
Returns

A string containing text that should be replace the source code indicated by AReplacementRange.

Properties

Public property ChildDiagnostics: IDiagnosticSet read GetChildDiagnostics;

Child diagnostics

Public property Severity: TDiagnosticSeverity read GetSeverity;

The severity of the diagnostic.

Public property Location: TSourceLocation read GetLocation;

The source location of the diagnostic.

This location is where Clang would print the caret ('ˆ') when displaying the diagnostic on the command line.

Public property Spelling: String read GetSpelling;

The text of the diagnostic.

Public property EnableOption: String read GetEnableOption;

The name of the command-line option that enabled this diagnostic, such as "-Wconversion" or "-pedantic".

Public property DisableOption: String read GetDisableOption;

The name of the command-line option that disables this diagnostic.

Public property Category: Integer read GetCategory;

The category number for this diagnostic.

Diagnostics can be categorized into groups along with other, related diagnostics (e.g., diagnostics under the same warning flag). This property retrieves the category number for the diagnostic, or zero if this diagnostic is uncategorized.

Public property CategoryText: String read GetCategoryText;

The diagnostic category text for the diagnostic.

Public property RangeCount: Integer read GetRangeCount;

The number of source ranges associated with the given diagnostic.

Public property Ranges[constAIndex:Integer]: TSourceRange read GetRange;

Source ranges associated with the diagnostic.

A diagnostic's source ranges highlight important elements in the source code. On the command line, Clang displays source ranges by underlining them with '˜' characters.

Public property FixItCount: Integer read GetFixItCount;

The number of fix-it hints associated with the given diagnostic.

Public property Handle: TCXDiagnostic read GetHandle;

Internal handle to C API


Generated by PasDocEx, based on PasDoc 0.14.0.