Table of Contents

Class DiagnosticFixes

Namespace
RDCore.SDK.Model.Diagnostics
Assembly
RDCore.SDK.dll

What can be done about a finding, which the platform knows how to do: the fixes an analyzer states with what it found, and which travel with the diagnostic in its data (LSP 3.17 Diagnostic.data) for the language server to offer as code actions.

public sealed record DiagnosticFixes : IEquatable<DiagnosticFixes>
Inheritance
DiagnosticFixes
Implements
Inherited Members

Remarks

An analyzer says what the fix is, and the platform makes it: a rename is planned by the language server against the whole workspace when it is asked for (SymbolRename), and is offered only when it can be made. An extension states a fix without knowing how the workspace is renamed, and gets the code actions of the platform for it. A fix that changes only the document the finding is in - the edits of one procedure - is the analyzer's to make, from the syntax tree it was given: it states the edits themselves (Edit).

Properties

Edit

The fix is a set of edits of the document the diagnostic is in, which the analyzer made; null when it is not.

[JsonProperty("edit", NullValueHandling = NullValueHandling.Ignore)]
public EditFix? Edit { get; init; }

Property Value

EditFix

Rename

The fix is to rename the name in the range of the diagnostic, which is the name of a declaration; null when it is not.

[JsonProperty("rename", NullValueHandling = NullValueHandling.Ignore)]
public RenameFix? Rename { get; init; }

Property Value

RenameFix

Methods

Of(Diagnostic)

The fixes a diagnostic carries, when it carries any: a diagnostic whose data is something else - the metadata of an error - has none.

public static DiagnosticFixes? Of(Diagnostic diagnostic)

Parameters

diagnostic Diagnostic

The diagnostic, as a client sent it back with a code action request.

Returns

DiagnosticFixes

ToData()

The fixes, as a diagnostic's data.

public JToken ToData()

Returns

JToken