Skip to content

Commit bbc1076

Browse files
Add CodeDescription link to buf lint rules (#4136)
1 parent 2f2c9ee commit bbc1076

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

private/buf/buflsp/file.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,11 @@ func (f *file) appendAnnotations(source string, annotations []bufanalysis.FileAn
779779
endLocation := f.file.InverseLocation(annotation.EndLine(), annotation.EndColumn(), positionalEncoding)
780780
protocolRange := reportLocationsToProtocolRange(startLocation, endLocation)
781781
f.diagnostics = append(f.diagnostics, protocol.Diagnostic{
782-
Range: protocolRange,
783-
Code: annotation.Type(),
782+
Range: protocolRange,
783+
Code: annotation.Type(),
784+
CodeDescription: &protocol.CodeDescription{
785+
Href: protocol.URI("https://buf.build/docs/lint/rules/#" + strings.ToLower(annotation.Type())),
786+
},
784787
Severity: protocol.DiagnosticSeverityWarning,
785788
Source: source,
786789
Message: annotation.Message(),

0 commit comments

Comments
 (0)