Skip to content

Commit

Permalink
feat: add a new $/snyk.scanSummary notificiation [IDE-868] (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
acke authored Jan 20, 2025
1 parent 5facb0f commit b692957
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ Right now the language server supports the following actions:
},
}
```
- Summary Panel Status Notification
- method: `$/snyk.scanSummary`
- params: `types.ScanSummary`
- example:
```json5
{
"scanSummary": "<html><body<p> Summary </p></body></html>"
}
```

### Commands

Expand Down
3 changes: 3 additions & 0 deletions application/server/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ func registerNotifier(c *config.Config, srv types.Server) {
Interface("source", source).
Interface("diagnosticCount", len(params.Diagnostics)).
Msg("publishing diagnostics")
case types.ScanSummary:
notifier(c, srv, "$/snyk.scanSummary", params)
logger.Debug().Msg("sending scan summary to client")
case types.ApplyWorkspaceEditParams:
handleApplyWorkspaceEdit(srv, params, &logger)
logger.Debug().
Expand Down
4 changes: 4 additions & 0 deletions internal/types/lsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,10 @@ type SnykIsAvailableCli struct {
CliPath string `json:"cliPath"`
}

type ScanSummary struct {
ScanSummary string `json:"scanSummary"`
}

type ProgressToken string

type ProgressParams struct {
Expand Down

0 comments on commit b692957

Please sign in to comment.