Skip to content

Commit daed78a

Browse files
tx3stndaveshanley
authored andcommitted
add more output to lsp message
1 parent bd800ca commit daed78a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

language-server/server.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,15 @@ func ConvertResultIntoDiagnostic(vacuumResult *model.RuleFunctionResult) protoco
185185
endChar = vacuumResult.EndNode.Column - 1
186186
}
187187

188+
// Build comprehensive message with rule details
189+
message := vacuumResult.Message
190+
if vacuumResult.Rule.Description != "" {
191+
message += "\n\nDescription: " + vacuumResult.Rule.Description
192+
}
193+
if vacuumResult.Rule.HowToFix != "" {
194+
message += "\n\nHow to fix: " + vacuumResult.Rule.HowToFix + "\n\nRule ID:"
195+
}
196+
188197
return protocol.Diagnostic{
189198
Range: protocol.Range{
190199
Start: protocol.Position{Line: protocol.UInteger(startLine),
@@ -196,7 +205,7 @@ func ConvertResultIntoDiagnostic(vacuumResult *model.RuleFunctionResult) protoco
196205
Source: &serverName,
197206
Code: &protocol.IntegerOrString{Value: vacuumResult.Rule.Id},
198207
CodeDescription: &protocol.CodeDescription{HRef: diagnosticErrorHref},
199-
Message: vacuumResult.Message,
208+
Message: message,
200209
}
201210
}
202211

0 commit comments

Comments
 (0)