Skip to content

Commit fa1ee48

Browse files
hardfistCopilot
andauthored
fix: add diags log (#193)
Co-authored-by: Copilot <[email protected]>
1 parent 33caa66 commit fa1ee48

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,4 @@ npm/*/rslint.exe
152152
.idea
153153

154154
## vscode settings
155-
.vscode/settings.json# Test CI trigger
155+
.vscode/settings.json

cmd/rslint/lsp.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ func (s *LSPServer) runDiagnostics(ctx context.Context, uri lsproto.DocumentUri,
381381
Diagnostics: lsp_diagnostics,
382382
}
383383

384+
var diagsBuilder strings.Builder
385+
for _, diag := range lsp_diagnostics {
386+
fmt.Fprintf(&diagsBuilder, "%v:%+v\n", diag.Message, diag.Range)
387+
}
388+
log.Printf("Publishing diagnostics for %s:\n%s", uri, diagsBuilder.String())
384389
s.conn.Notify(ctx, "textDocument/publishDiagnostics", params)
385390
}
386391

0 commit comments

Comments
 (0)