Interface IDiagnostic
Unit
Neslib.Clang
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
Overview
Methods
Properties
Description
Methods
 |
function GetSpelling: String; |
|
 |
function GetEnableOption: String; |
|
 |
function GetDisableOption: String; |
|
 |
function GetCategory: Integer; |
|
 |
function GetCategoryText: String; |
|
 |
function GetRangeCount: Integer; |
|
 |
function GetFixItCount: Integer; |
|
 |
function GetHandle: TCXDiagnostic; |
|
 |
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. |
 |
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
 |
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.
|
 |
property Spelling: String read GetSpelling; |
The text of the diagnostic.
|
 |
property EnableOption: String read GetEnableOption; |
The name of the command-line option that enabled this diagnostic, such as "-Wconversion" or "-pedantic".
|
 |
property DisableOption: String read GetDisableOption; |
The name of the command-line option that disables this diagnostic.
|
 |
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.
|
 |
property RangeCount: Integer read GetRangeCount; |
The number of source ranges associated with the given diagnostic.
|
 |
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.
|
 |
property FixItCount: Integer read GetFixItCount; |
The number of fix-it hints associated with the given diagnostic.
|
 |
property Handle: TCXDiagnostic read GetHandle; |
Internal handle to C API
|
Generated by PasDocEx, based on PasDoc 0.14.0.
|