From f340bd73b5146a0653b2126e7900c467c89e4398 Mon Sep 17 00:00:00 2001 From: Abdelrahman Shawki Hassan Date: Mon, 2 Sep 2024 10:25:43 +0200 Subject: [PATCH] feat: send a new publishDiagnostics notification (#639) --- README.md | 9 +++++++++ application/server/notification.go | 1 + 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 55888a476..d85cb64b3 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,15 @@ Right now the language server supports the following actions: ] } ``` +- Custom Publish Diagnostics Notification +- method: `$/snyk.publishDiagnostics316` + - payload: + ```json5 + { + "uri": "/path/to/file", + "diagnostics": [], + } + ``` - Authentication Notification - method: `$/snyk.hasAuthenticated` - payload: diff --git a/application/server/notification.go b/application/server/notification.go index 2d62af8bc..2533bba49 100644 --- a/application/server/notification.go +++ b/application/server/notification.go @@ -108,6 +108,7 @@ func registerNotifier(c *config.Config, srv types.Server) { Msgf("publishing diagnostics overview for %s", params.Product) case types.PublishDiagnosticsParams: notifier(c, srv, "textDocument/publishDiagnostics", params) + notifier(c, srv, "$/snyk.publishDiagnostics316", params) source := "LSP" if len(params.Diagnostics) > 0 { source = params.Diagnostics[0].Source