Skip to content

Commit 10a3980

Browse files
feat: add new folder config field to configure pre/post scan commands
1 parent 48d0dca commit 10a3980

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

internal/types/lsp.go

+13-5
Original file line numberDiff line numberDiff line change
@@ -528,15 +528,23 @@ type WorkspaceFoldersChangeEvent struct {
528528
Removed []WorkspaceFolder `json:"Removed,omitempty"`
529529
}
530530

531+
type ScanCommandConfig struct {
532+
PreScanCommand string `json:"command,omitempty"`
533+
PreScanOnlyReferenceFolder bool `json:"preScanOnlyReferenceFolder,omitempty"`
534+
PostScanCommand string `json:"postScanCommand,omitempty"`
535+
PostScanOnlyReferenceFolder bool `json:"postScanOnlyReferenceFolder,omitempty"`
536+
}
537+
531538
// FolderConfig is exchanged between IDE and LS
532539
// IDE sends this as part of the settings/initialization
533540
// LS sends this via the $/snyk.folderConfig notification
534541
type FolderConfig struct {
535-
FolderPath string `json:"folderPath"`
536-
BaseBranch string `json:"baseBranch"`
537-
LocalBranches []string `json:"localBranches,omitempty"`
538-
AdditionalParameters []string `json:"additionalParameters,omitempty"`
539-
ReferenceFolderPath string `json:"referenceFolderPath,omitempty"`
542+
FolderPath string `json:"folderPath"`
543+
BaseBranch string `json:"baseBranch"`
544+
LocalBranches []string `json:"localBranches,omitempty"`
545+
AdditionalParameters []string `json:"additionalParameters,omitempty"`
546+
ReferenceFolderPath string `json:"referenceFolderPath,omitempty"`
547+
ScanCommandConfig ScanCommandConfig `json:"preScanCommandConfig,omitempty"`
540548
}
541549

542550
type Pair struct {

0 commit comments

Comments
 (0)