Documentation
¶
Overview ¶
Package types provides commonly used types
Index ¶
- Constants
- Variables
- func GetCvssCalculatorUrl(cvssSources []CvssSource) string
- func NoopResultProcessor(_ context.Context, _ ScanData)
- func UpdateSeverityCount(sic SeverityIssueCounts, issue Issue)
- type AnalyticsEventParam
- type ApplyWorkspaceEditParams
- type ApplyWorkspaceEditResult
- type AuthenticationMethod
- type AuthenticationParams
- type Clearer
- type CliError
- type CliOutput
- type ClientCapabilities
- type CodeAction
- type CodeActionContext
- type CodeActionData
- type CodeActionKind
- type CodeActionOptions
- type CodeActionParams
- type CodeActionTriggerKind
- type CodeDescription
- type CodeFlowPositionInFile
- type CodeIssueData
- type CodeLensRefresh
- type CodeLensWorkspaceClientCapabilities
- type Command
- type CommandData
- type CommandName
- type CommandService
- type CommandServiceMock
- type CommitChangeLine
- type CompletionItemKind
- type ConfigurationItem
- type ConfigurationParams
- type CvssSource
- type DataflowElement
- type DeleteFilesParams
- type Diagnostic
- type DiagnosticRelatedInformation
- type DiagnosticResult
- type DiagnosticSeverity
- type DiagnosticTag
- type DidChangeConfigurationParams
- type DidChangeWorkspaceFoldersParams
- type DocumentationFormat
- type FileDelete
- type FileOperationFilter
- type FileOperationPattern
- type FileOperationRegistrationOptions
- type FileOperationsServerCapabilities
- type FilePath
- type Filterable
- type Folder
- type FolderConfig
- type FolderConfigsParam
- type FolderStatus
- type GetSdk
- type Groupable
- type GroupingFunction
- type GroupingType
- type IacIssueData
- type IgnoreDetails
- type InitializeParams
- type InitializeResult
- type InitializedParams
- type InlineValue
- type InlineValueContext
- type InlineValueParams
- type InlineValueRefresh
- type InlineValueWorkspaceClientCapabilities
- type Issue
- type IssueAdditionalData
- type IssueCount
- type IssueType
- type IssueViewOptions
- type IssuesByFile
- type Key
- type LSPCodeAction
- type LogMessageParams
- type LogTraceParams
- type LsSdk
- type Marker
- type MarkerPosition
- type MessageAction
- type MessageActionItem
- type MessageType
- type OpenBrowserFunc
- type OssIdentifiers
- type OssIssueData
- type Pair
- type Point
- type Position
- type PresentableError
- type ProductScanner
- type ProgressParams
- type ProgressToken
- type PublishDiagnosticsParams
- type Range
- type Reference
- type ScanCommandConfig
- type ScanData
- type ScanIssue
- type ScanResultProcessor
- type ScanSnapshotClearerExister
- type ScanStatus
- type ScanSummary
- type Scanner
- type Server
- type ServerCapabilities
- type ServerInfo
- type Settings
- type Severity
- type SeverityFilter
- type SeverityIssueCounts
- type ShowDocumentParams
- type ShowMessageRequest
- type ShowMessageRequestParams
- type SnykIsAvailableCli
- type SnykRegisterMcpParams
- type SnykScanParams
- type SnykTrustedFoldersParams
- type TextDocumentClientCapabilities
- type TextDocumentSaveReason
- type TextEdit
- type TrustRequester
- type Uri
- type WillSaveTextDocumentParams
- type WindowClientCapabilities
- type WorkDoneProgressBegin
- type WorkDoneProgressEnd
- type WorkDoneProgressKind
- type WorkDoneProgressReport
- type WorkdoneProgressCancelParams
- type Workspace
- type WorkspaceCapabilities
- type WorkspaceClientCapabilities
- type WorkspaceEdit
- type WorkspaceFolder
- type WorkspaceFoldersChangeEvent
- type WorkspaceFoldersServerCapabilities
Constants ¶
const ( WorkspaceScanCommand = "snyk.workspace.scan" WorkspaceFolderScanCommand = "snyk.workspaceFolder.scan" OpenBrowserCommand = "snyk.openBrowser" LoginCommand = "snyk.login" CopyAuthLinkCommand = "snyk.copyAuthLink" LogoutCommand = "snyk.logout" TrustWorkspaceFoldersCommand = "snyk.trustWorkspaceFolders" OpenLearnLesson = "snyk.openLearnLesson" GetLearnLesson = "snyk.getLearnLesson" GetSettingsSastEnabled = "snyk.getSettingsSastEnabled" GetFeatureFlagStatus = "snyk.getFeatureFlagStatus" GetActiveUserCommand = "snyk.getActiveUser" ReportAnalyticsCommand = "snyk.reportAnalytics" ClearCacheCommand = "snyk.clearCache" GenerateIssueDescriptionCommand = "snyk.generateIssueDescription" SubmitIgnoreRequest = "snyk.submitIgnoreRequest" WorkspaceConfigurationCommand = "snyk.workspace.configuration" // Snyk Code specific commands CodeFixCommand = "snyk.code.fix" CodeFixDiffsCommand = "snyk.code.fixDiffs" CodeFixApplyEditCommand = "snyk.code.fixApplyEdit" CodeSubmitFixFeedback = "snyk.code.submitFixFeedback" // bridging commands ExecuteCLICommand = "snyk.executeCLI" )
const ( WorkDoneProgressBeginKind = "begin" WorkDoneProgressReportKind = "report" WorkDoneProgressEndKind = "end" )
Variables ¶
Functions ¶
func GetCvssCalculatorUrl ¶ added in v1.1303.0
func GetCvssCalculatorUrl(cvssSources []CvssSource) string
GetCvssCalculatorUrl returns the appropriate CVSS calculator URL based on cvssSources
func NoopResultProcessor ¶ added in v1.1303.0
func UpdateSeverityCount ¶ added in v1.1303.0
func UpdateSeverityCount(sic SeverityIssueCounts, issue Issue)
Types ¶
type AnalyticsEventParam ¶
type AnalyticsEventParam struct {
InteractionType string `json:"interactionType"`
Category []string `json:"category"`
Status string `json:"status"`
TargetId string `json:"targetId"`
TimestampMs int64 `json:"timestampMs"`
DurationMs int64 `json:"durationMs"`
Results map[string]any `json:"results"`
Errors []any `json:"errors"`
Extension map[string]any `json:"extension"`
InteractionUUID string `json:"interactionId"`
}
type ApplyWorkspaceEditParams ¶
type ApplyWorkspaceEditParams struct {
Label string `json:"label,omitempty"`
/**
* The edits to apply.
*/
Edit *sglsp.WorkspaceEdit `json:"edit"`
}
type ApplyWorkspaceEditResult ¶
type ApplyWorkspaceEditResult struct {
/**
* Indicates whether the edit was applied or not.
*/
Applied bool `json:"applied"`
/**
* An optional textual description for why the edit was not applied.
* This may be used by the server for diagnostic logging or to provide
* a suitable error for a request that triggered the edit.
*/
FailureReason string `json:"failureReason,omitempty"`
/**
* Depending on the client's failure handling strategy `failedChange`
* might contain the index of the change that failed. This property is
* only available if the client signals a `failureHandling` strategy
* in its client capabilities.
*/
FailedChange uint `json:"failedChange,omitempty"`
}
type AuthenticationMethod ¶
type AuthenticationMethod string
const ( TokenAuthentication AuthenticationMethod = "token" OAuthAuthentication AuthenticationMethod = "oauth" PatAuthentication AuthenticationMethod = "pat" FakeAuthentication AuthenticationMethod = "fake" EmptyAuthenticationMethod AuthenticationMethod = "" )
type AuthenticationParams ¶
type ClientCapabilities ¶
type ClientCapabilities struct {
Workspace WorkspaceClientCapabilities `json:"workspace,omitempty"`
TextDocument TextDocumentClientCapabilities `json:"textDocument,omitempty"`
Window WindowClientCapabilities `json:"window,omitempty"`
Experimental any `json:"experimental,omitempty"`
}
type CodeAction ¶
type CodeAction interface {
Groupable
GetTitle() string
GetOriginalTitle() string
GetIsPreferred() *bool
GetEdit() *WorkspaceEdit
GetDeferredEdit() *func() *WorkspaceEdit
GetCommand() *CommandData
GetDeferredCommand() *func() *CommandData
GetUuid() *uuid.UUID
SetTitle(title string)
SetEdit(edit *WorkspaceEdit)
}
type CodeActionContext ¶
type CodeActionContext struct {
/**
* An array of diagnostics known on the client side overlapping the range provided to the
* `textDocument/codeAction` request. They are provided so that the server knows which
* errors are currently presented to the user for the given range. There is no guarantee
* that these accurately reflect the error state of the resource. The primary parameter
* to compute code actions is the provided range.
*/
Diagnostics []Diagnostic `json:"diagnostics"`
/**
* Requested kind of actions to return.
*
* Actions not of this kind are filtered out by the client before being shown. So servers
* can omit computing them.
*/
Only []CodeActionKind `json:"only,omitempty"`
/**
* The reason why code actions were requested.
*
* @since 3.17.0
*/
TriggerKind CodeActionTriggerKind `json:"triggerKind,omitempty"`
}
type CodeActionData ¶
type CodeActionKind ¶
type CodeActionKind string
const RefactorExtract CodeActionKind = "refactor.extract"
*
- Base kind for refactoring extraction actions: 'refactor.extract'. *
- Example extract actions: *
- - Extract method
- - Extract function
- - Extract variable
- - Extract interface from class
- - ...
const RefactorInline CodeActionKind = "refactor.inline"
*
- Base kind for refactoring inline actions: 'refactor.inline'. *
- Example inline actions: *
- - Inline function
- - Inline variable
- - Inline constant
- - ...
const RefactorRewrite CodeActionKind = "refactor.rewrite"
*
- Base kind for refactoring rewrite actions: 'refactor.rewrite'. *
- Example rewrite actions: *
- - Convert JavaScript function to class
- - Add or remove parameter
- - Encapsulate field
- - Make method static
- - Move method to base class
- - ...
const Source CodeActionKind = "source"
*
- Base kind for source actions: `source`. *
- Source code actions apply to the entire file.
const SourceFixAll CodeActionKind = "source.fixAll"
*
- Base kind for a "fix all" source action `source.fixAll`. *
- ""Fix all"" actions automatically fix errors that have a clear fix that
- do not require user input. They should not suppress errors or perform
- unsafe fixes such as generating new types or classes. *
- @since 3.17.0
const SourceOrganizeImports CodeActionKind = "source.organizeImports"
*
- Base kind for an organize imports source action
- `source.organizeImports`.
type CodeActionOptions ¶
type CodeActionOptions struct {
ResolveProvider bool `json:"resolveProvider,omitempty"`
}
type CodeActionParams ¶
type CodeActionParams struct {
/**
* The document in which the command was invoked.
*/
TextDocument sglsp.TextDocumentIdentifier `json:"textDocument"`
/**
* The range for which the command was invoked.
*/
Range sglsp.Range `json:"range"`
/**
* Context carrying additional information.
*/
Context CodeActionContext `json:"context"`
}
type CodeActionTriggerKind ¶
type CodeActionTriggerKind float64
type CodeDescription ¶
type CodeDescription struct {
Href Uri `json:"href"`
}
type CodeFlowPositionInFile ¶ added in v1.1303.0
type CodeIssueData ¶
type CodeIssueData struct {
Key string `json:"key,omitempty"`
Message string `json:"message"`
LeadURL string `json:"leadURL,omitempty"`
Rule string `json:"rule"`
RuleId string `json:"ruleId"`
RepoDatasetSize int `json:"repoDatasetSize"`
CWE []string `json:"cwe"`
Text string `json:"text"`
Markers []Marker `json:"markers,omitempty"`
Cols Point `json:"cols"`
Rows Point `json:"rows"`
IsSecurityType bool `json:"isSecurityType"`
PriorityScore int `json:"priorityScore"`
HasAIFix bool `json:"hasAIFix"`
DataFlow []DataflowElement `json:"dataFlow,omitempty"`
}
type CodeLensRefresh ¶
type CodeLensRefresh struct{}
type CodeLensWorkspaceClientCapabilities ¶
type CodeLensWorkspaceClientCapabilities struct {
/**
* Whether the client implementation supports a refresh request sent from the
* server to the client.
*
* Note that this event is global and will force the client to refresh all
* code lenses currently shown. It should be used with absolute care and is
* useful for situation where a server for example detect a project wide
* change that requires such a calculation.
*/
RefreshSupport bool `json:"refreshSupport,omitempty"`
}
type Command ¶
type Command interface {
Command() CommandData
Execute(ctx context.Context) (any, error)
}
type CommandData ¶
type CommandData struct {
/**
* Title of the command, like `save`.
*/
Title string
/**
* The identifier of the actual command handler.
*/
CommandId string
/**
* Arguments that the command handler should be
* invoked with.
*/
Arguments []any
GroupingKey Key
GroupingType GroupingType
GroupingValue any
}
func (CommandData) GetGroupingKey ¶
func (c CommandData) GetGroupingKey() Key
func (CommandData) GetGroupingType ¶
func (c CommandData) GetGroupingType() GroupingType
func (CommandData) GetGroupingValue ¶
func (c CommandData) GetGroupingValue() any
type CommandName ¶
type CommandName string
type CommandService ¶
type CommandServiceMock ¶
type CommandServiceMock struct {
// contains filtered or unexported fields
}
func NewCommandServiceMock ¶
func NewCommandServiceMock() *CommandServiceMock
func (*CommandServiceMock) ExecuteCommandData ¶
func (service *CommandServiceMock) ExecuteCommandData(_ context.Context, command CommandData, _ Server) (any, error)
func (*CommandServiceMock) ExecutedCommands ¶
func (service *CommandServiceMock) ExecutedCommands() []CommandData
type CommitChangeLine ¶
type CompletionItemKind ¶
type CompletionItemKind int
type ConfigurationItem ¶
type ConfigurationParams ¶
type ConfigurationParams struct {
Items []ConfigurationItem `json:"items"`
}
*
- The parameters of a configuration request.
type CvssSource ¶ added in v1.1303.0
type CvssSource struct {
Type string `json:"type"`
Vector string `json:"vector"`
Assigner string `json:"assigner"`
Severity string `json:"severity"`
BaseScore float64 `json:"baseScore"`
CvssVersion string `json:"cvssVersion"`
ModificationTime string `json:"modificationTime"`
}
CvssSource represents CVSS scoring information from various sources
type DataflowElement ¶
type DeleteFilesParams ¶
type DeleteFilesParams struct {
Files []FileDelete `json:"files,omitempty"`
}
type Diagnostic ¶
type Diagnostic struct {
/**
* The range at which the message applies.
*/
Range sglsp.Range `json:"range"`
/**
* The diagnostic's severity. Can be omitted. If omitted it is up to the
* client to interpret diagnostics as error, warning, info or hint.
*/
Severity DiagnosticSeverity `json:"severity,omitempty"`
/**
* The diagnostic's code. Can be omitted. Can be string or int, thus we need
* any type
*/
Code any `json:"code,omitempty"`
/**
* A human-readable string describing the source of this
* diagnostic, e.g. 'typescript' or 'super lint'.
*/
Source string `json:"source,omitempty"`
/**
* The diagnostic's message.
*/
Message string `json:"message"`
/**
* An optional property to describe the error code.
*
* @since 3.16.0
*/
CodeDescription CodeDescription `json:"codeDescription,omitempty"`
/**
* Additional metadata about the diagnostic.
*
* @since 3.15.0
*/
Tags []DiagnosticTag `json:"diagnosticTag,omitempty"`
/**
* An array of related diagnostic information, e.g. when symbol-names within
* a scope collide all definitions can be marked via this property.
*/
RelatedInformation []DiagnosticRelatedInformation `json:"relatedInformation,omitempty"`
/**
* A data entry field that is preserved between a
* `textDocument/publishDiagnostics` notification and
* `textDocument/codeAction` request.
*
* @since 3.16.0
*/
Data ScanIssue `json:"data,omitempty"`
}
type DiagnosticResult ¶
type DiagnosticResult struct {
Uri sglsp.DocumentURI
Diagnostics []Diagnostic
Err error
}
type DiagnosticSeverity ¶
type DiagnosticSeverity int
const ( DiagnosticsSeverityError DiagnosticSeverity = 1 DiagnosticsSeverityWarning DiagnosticSeverity = 2 DiagnosticsSeverityInformation DiagnosticSeverity = 3 DiagnosticsSeverityHint DiagnosticSeverity = 4 )
type DiagnosticTag ¶
type DiagnosticTag int
const ( /** * Unused or unnecessary code. * * Clients are allowed to render diagnostics with this tag faded out * instead of having an error squiggle. */ Unnecessary DiagnosticTag = 1 /** * Deprecated or obsolete code. * * Clients are allowed to rendered diagnostics with this tag strike through. */ Deprecated DiagnosticTag = 2 )
type DidChangeConfigurationParams ¶
type DidChangeConfigurationParams struct {
// The actual changed settings
Settings Settings `json:"settings"`
}
type DidChangeWorkspaceFoldersParams ¶
type DidChangeWorkspaceFoldersParams struct {
// The actual workspace folder change Event.
Event WorkspaceFoldersChangeEvent `json:"Event,omitempty"`
}
type DocumentationFormat ¶
type DocumentationFormat string
type FileDelete ¶
type FileDelete struct {
Uri sglsp.DocumentURI `json:"uri,omitempty"`
}
type FileOperationFilter ¶
type FileOperationFilter struct {
Pattern FileOperationPattern `json:"pattern,omitempty"`
}
type FileOperationPattern ¶
type FileOperationPattern struct {
Glob string `json:"glob,omitempty"`
}
type FileOperationRegistrationOptions ¶
type FileOperationRegistrationOptions struct {
Filters []FileOperationFilter `json:"filters,omitempty"`
}
type FileOperationsServerCapabilities ¶
type FileOperationsServerCapabilities struct {
WillDeleteBool bool `json:"willDeleteBool,omitempty"`
WillDelete FileOperationRegistrationOptions `json:"willDelete,omitempty"`
}
type Filterable ¶
type Filterable interface {
GetFilteringKey() Key
}
type Folder ¶
type Folder interface {
Clearer
ClearDiagnosticsByIssueType(removedType product.FilterableIssueType)
IsScanned() bool
SetStatus(status FolderStatus)
ScanFolder(ctx context.Context)
ScanFile(ctx context.Context, path FilePath)
Contains(path FilePath) bool
FilterAndPublishDiagnostics(p product.Product)
Path() FilePath
Uri() lsp.DocumentURI
Name() string
Status() FolderStatus
IsTrusted() bool
ScanResultProcessor() ScanResultProcessor
}
type FolderConfig ¶
type FolderConfig struct {
FolderPath FilePath `json:"folderPath"`
BaseBranch string `json:"baseBranch"`
LocalBranches []string `json:"localBranches,omitempty"`
AdditionalParameters []string `json:"additionalParameters,omitempty"`
AdditionalEnv string `json:"additionalEnv,omitempty"`
ReferenceFolderPath FilePath `json:"referenceFolderPath,omitempty"`
ScanCommandConfig map[product.Product]ScanCommandConfig `json:"scanCommandConfig,omitempty"`
PreferredOrg string `json:"preferredOrg"`
AutoDeterminedOrg string `json:"autoDeterminedOrg"`
OrgMigratedFromGlobalConfig bool `json:"orgMigratedFromGlobalConfig"`
OrgSetByUser bool `json:"orgSetByUser"`
FeatureFlags map[string]bool `json:"featureFlags"`
SastSettings *sast_contract.SastResponse `json:"sastSettings"`
}
FolderConfig is exchanged between IDE and LS IDE sends this as part of the settings/initialization LS sends this via the $/snyk.folderConfig notification
func (*FolderConfig) Clone ¶ added in v1.1303.0
func (fc *FolderConfig) Clone() *FolderConfig
type FolderConfigsParam ¶
type FolderConfigsParam struct {
FolderConfigs []FolderConfig `json:"folderConfigs"`
}
type FolderStatus ¶
type FolderStatus int
type Groupable ¶
type Groupable interface {
GetGroupingKey() Key
GetGroupingValue() any
GetGroupingType() GroupingType
}
type GroupingFunction ¶
func MaxSemver ¶
func MaxSemver(logger zerolog.Logger) GroupingFunction
type IacIssueData ¶
type IacIssueData struct {
Key string `json:"key,omitempty"`
PublicId string `json:"publicId"`
Documentation string `json:"documentation"`
LineNumber int `json:"lineNumber"`
Issue string `json:"issue"`
Impact string `json:"impact"`
Resolve string `json:"resolve,omitempty"`
Path []string `json:"path"`
References []string `json:"references,omitempty"`
}
type IgnoreDetails ¶
type IgnoreDetails struct {
Category string `json:"category"`
Reason string `json:"reason"`
Expiration string `json:"expiration"`
IgnoredOn time.Time `json:"ignoredOn"`
IgnoredBy string `json:"ignoredBy"`
Status codeClientSarif.SuppresionStatus `json:"status"`
}
type InitializeParams ¶
type InitializeParams struct {
ProcessID int `json:"processId,omitempty"`
// RootPath is DEPRECATED in favor of the RootURI field.
RootPath string `json:"rootPath,omitempty"`
// The rootUri of the workspace. Is null if no folder is open. If both `rootPath` and `rootUri` are set `rootUri` wins.
RootURI sglsp.DocumentURI `json:"rootUri,omitempty"`
ClientInfo sglsp.ClientInfo `json:"clientInfo,omitempty"`
Trace sglsp.Trace `json:"trace,omitempty"`
InitializationOptions Settings `json:"initializationOptions,omitempty"`
Capabilities ClientCapabilities `json:"capabilities"`
WorkDoneToken string `json:"workDoneToken,omitempty"`
WorkspaceFolders []WorkspaceFolder `json:"workspaceFolders,omitempty"`
}
type InitializeResult ¶
type InitializeResult struct {
ServerInfo ServerInfo `json:"serverInfo,omitempty"`
Capabilities ServerCapabilities `json:"capabilities,omitempty"`
}
type InitializedParams ¶
type InitializedParams struct{}
type InlineValue ¶
type InlineValue struct {
/**
* The document range for which the inline value applies.
*/
Range sglsp.Range `json:"range"`
/**
* The text of the inline value.
*/
Text string `json:"text"`
}
*
- Provide inline value as text. *
- @since 3.17.0
type InlineValueContext ¶
type InlineValueContext struct {
/**
* The stack frame (as a DAP Id) where the execution has stopped.
*/
FrameId int `json:"frameId"`
/**
* The document range where execution has stopped.
* Typically the end position of the range denotes the line where the
* inline values are shown.
*/
StoppedLocation sglsp.Range `json:"stoppedLocation"`
}
type InlineValueParams ¶
type InlineValueParams struct {
/**
* The text document.
*/
TextDocument sglsp.TextDocumentIdentifier `json:"textDocument"`
/**
* The document range for which inline values should be computed.
*/
Range sglsp.Range `json:"range"`
/**
* Additional information about the context in which inline values were
* requested.
*/
Context InlineValueContext `json:"context"`
}
*
- A parameter literal used in inline value requests. *
- @since 3.17.0
type InlineValueRefresh ¶
type InlineValueRefresh struct{}
type InlineValueWorkspaceClientCapabilities ¶
type InlineValueWorkspaceClientCapabilities struct {
/**
* Whether the client implementation supports a refresh request sent from the
* server to the client.
*
* Note that this event is global and will force the client to refresh all
* inline values currently shown. It should be used with absolute care and is
* useful for situation where a server for example detect a project wide
* change that requires such a calculation.
*/
RefreshSupport bool `json:"refreshSupport,omitempty"`
}
type Issue ¶ added in v1.1303.0
type Issue interface {
fmt.Stringer
GetID() string
GetRange() Range
GetMessage() string
GetFormattedMessage() string
GetAffectedFilePath() FilePath
GetContentRoot() FilePath
GetIsNew() bool
GetIsIgnored() bool
SetIgnored(isIgnored bool)
GetSeverity() Severity
GetIgnoreDetails() *IgnoreDetails
GetProduct() product.Product
GetFingerprint() string
GetGlobalIdentity() string
GetAdditionalData() IssueAdditionalData
GetEcosystem() string
GetCWEs() []string
GetCVEs() []string
GetIssueType() IssueType
GetLessonUrl() string
GetIssueDescriptionURL() *url.URL
GetCodeActions() []CodeAction
GetCodelensCommands() []CommandData
GetFilterableIssueType() product.FilterableIssueType
GetRuleID() string
GetReferences() []Reference
GetFindingId() string
SetCodelensCommands(lenses []CommandData)
SetLessonUrl(url string)
SetAdditionalData(data IssueAdditionalData)
SetGlobalIdentity(globalIdentity string)
SetIsNew(isNew bool)
SetCodeActions(actions []CodeAction)
SetRange(r Range)
SetIgnoreDetails(ignoreDetails *IgnoreDetails)
}
type IssueAdditionalData ¶ added in v1.1303.0
type IssueCount ¶ added in v1.1303.0
type IssueType ¶ added in v1.1303.0
type IssueType int8
IssueType will typically match 1o1 to Snyk product lines but are not necessarily coupled to those.
type IssueViewOptions ¶ added in v1.1303.0
type IssueViewOptions struct {
OpenIssues bool `json:"openIssues,omitempty"`
IgnoredIssues bool `json:"ignoredIssues,omitempty"`
}
func DefaultIssueViewOptions ¶ added in v1.1303.0
func DefaultIssueViewOptions() IssueViewOptions
func NewIssueViewOptions ¶ added in v1.1303.0
func NewIssueViewOptions(openIssues bool, ignoredIssues bool) IssueViewOptions
type IssuesByFile ¶ added in v1.1303.0
type LSPCodeAction ¶ added in v1.1303.0
type LSPCodeAction struct {
/**
* A short, human-readable, title for this code action.
*/
Title string `json:"title"`
/**
* The kind of the code action.
*
* Used to filter code actions.
*/
Kind CodeActionKind `json:"kind,omitempty"`
/**
* The diagnostics that this code action resolves.
*/
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
/**
* Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted
* by keybindings.
*
* A quick fix should be marked preferred if it properly addresses the underlying error.
* A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
*
* @since 3.15.0
*/
IsPreferred *bool `json:"isPreferred,omitempty"`
/**
* Marks that the code action cannot currently be applied.
*
* Clients should follow the following guidelines regarding disabled code actions:
*
* - Disabled code actions are not shown in automatic [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)
* code action menu.
*
* - Disabled actions are shown as faded out in the code action menu when the user request a more specific type
* of code action, such as refactorings.
*
* - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)
* that auto applies a code action and only a disabled code actions are returned, the client should show the user an
* error message with `reason` in the editor.
*
* @since 3.16.0
*/
Disabled *struct {
/**
* Human readable description of why the code action is currently disabled.
*
* This is displayed in the code actions UI.
*/
Reason string `json:"reason"`
} `json:"disabled,omitempty"`
/**
* The workspace edit this code action performs.
*/
Edit *sglsp.WorkspaceEdit `json:"edit,omitempty"`
/**
* A command this code action executes. If a code action
* provides an edit and a command, first the edit is
* executed and then the command.
*/
Command *sglsp.Command `json:"command,omitempty"`
/**
* A data entry field that is preserved on a code action between
* a `textDocument/codeAction` and a `codeAction/resolve` request.
*
* Holds a UUID that is used to identify the code action in the resolve request.
*/
Data *CodeActionData `json:"data,omitempty"`
}
*
- A CodeAction represents a change that can be performed in code, e.g. to fix a problem or
- to refactor code. *
- A CodeAction can be of these forms:
- 1. Has Edit but No Command - A simple edit that will be applied when the action is invoked
- 2. Has Command but No Edit - A command that will be executed when the action is invoked
- 3. Has both Edit and Command - A command that will be executed after the edit will be applied
- 4. Has neither Edit nor Command - A deferred code action that would be resolved after codeAction/resolve is received. *
- A deferred code action would have both Edit & Command omitted, and when invoked by the user, the server would send
- a new CodeAction with the Edit and/or Command fields populated.
type LogMessageParams ¶
type LogMessageParams struct {
/**
* The message type. See {@link MessageType}
*/
Type MessageType `json:"type"`
/**
* The actual message
*/
Message string `json:"message"`
}
type LogTraceParams ¶
type Marker ¶
type Marker struct {
Msg Point `json:"msg"`
Pos []MarkerPosition `json:"pos"`
}
type MarkerPosition ¶
type MarkerPosition struct {
CodeFlowPositionInFile
File string `json:"file"`
}
type MessageAction ¶
type MessageAction string
type MessageActionItem ¶
type MessageActionItem struct {
Title string `json:"title"`
}
type MessageType ¶
type MessageType int
const ( Error MessageType = 1 Warning MessageType = 2 Info MessageType = 3 Log MessageType = 4 )
type OpenBrowserFunc ¶ added in v1.1303.0
type OpenBrowserFunc func(url string)
type OssIdentifiers ¶
type OssIssueData ¶
type OssIssueData struct {
Key string `json:"key,omitempty"`
RuleId string `json:"ruleId"`
Title string `json:"title,omitempty"`
License string `json:"license,omitempty"`
Identifiers OssIdentifiers `json:"identifiers,omitempty"`
Description string `json:"description"`
Language string `json:"language"`
PackageManager string `json:"packageManager"`
PackageName string `json:"packageName"`
Name string `json:"name"`
Version string `json:"version"`
Exploit string `json:"exploit,omitempty"`
CVSSv3 string `json:"CVSSv3,omitempty"`
CvssScore string `json:"cvssScore,omitempty"`
CvssSources []CvssSource `json:"cvssSources,omitempty"`
FixedIn []string `json:"fixedIn,omitempty"`
From []string `json:"from"`
UpgradePath []any `json:"upgradePath"`
IsPatchable bool `json:"isPatchable"`
IsUpgradable bool `json:"isUpgradable"`
ProjectName string `json:"projectName"`
DisplayTargetFile FilePath `json:"displayTargetFile"`
MatchingIssues []OssIssueData `json:"matchingIssues"`
Lesson string `json:"lessonUrl,omitempty"`
RiskScore uint16 `json:"riskScore,omitempty"`
}
type Position ¶
type PresentableError ¶ added in v1.1303.0
type PresentableError struct {
CliError `json:",inline"`
// ShowNotification is for IDE to decide to display a notification or not
ShowNotification bool `json:"showNotification"`
// TreeNodeSuffix is an optional suffix message to be displayed in the tree node in IDEs
TreeNodeSuffix string `json:"treeNodeSuffix"`
}
type ProductScanner ¶ added in v1.1303.0
type ProductScanner interface {
// Scan scans a workspace folder or file for issues, given its path. 'folderPath' provides a path to a workspace folder, if a file needs to be scanned.
Scan(ctx context.Context, path FilePath, folderPath FilePath, folderConfig *FolderConfig) (issues []Issue, err error)
IsEnabled() bool
Product() product.Product
}
type ProgressParams ¶
type ProgressParams struct {
/**
* The progress token provided by the client or server.
*/
Token ProgressToken `json:"token"`
/**
* The progress data.
*/
Value any `json:"value,omitempty"`
}
type ProgressToken ¶
type ProgressToken string
type PublishDiagnosticsParams ¶
type PublishDiagnosticsParams struct {
URI sglsp.DocumentURI `json:"uri"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
type Range ¶ added in v1.1303.0
type Range struct {
/**
* The range's start position.
*/
Start Position
/**
* The range's end position.
*/
End Position
}
func (Range) Contains ¶ added in v1.1303.0
Contains returns true if the otherRange is contained within the range
type ScanCommandConfig ¶ added in v1.1303.0
type ScanCommandConfig struct {
PreScanCommand string `json:"preScanCommand,omitempty"`
PreScanOnlyReferenceFolder bool `json:"preScanOnlyReferenceFolder,omitempty"`
PostScanCommand string `json:"postScanCommand,omitempty"`
PostScanOnlyReferenceFolder bool `json:"postScanOnlyReferenceFolder,omitempty"`
}
ScanCommandConfig allows to define a command that is run before (PreScanCommand) or after (PostScanCommand) a scan. It will only be run for the referenceFolder / referenceScan (in case of delta) if the corresponding parameter PreScanOnlyReferenceFolder / PostScanOnlyReferenceFolder is set. Else it will run for all scans.
type ScanData ¶ added in v1.1303.0
type ScanData struct {
Product product.Product
Issues []Issue
Err error
Duration time.Duration
TimestampFinished time.Time
Path FilePath
IsDeltaScan bool
SendAnalytics bool
UpdateGlobalCache bool
}
func (ScanData) GetSeverityIssueCounts ¶ added in v1.1303.0
func (s ScanData) GetSeverityIssueCounts() SeverityIssueCounts
type ScanIssue ¶
type ScanIssue struct {
// Unique key identifying an issue in the whole result set. Not the same as the Snyk issue ID.
Id string `json:"id"`
Title string `json:"title"`
Severity string `json:"severity"`
FilePath FilePath `json:"filePath"`
ContentRoot FilePath `json:"contentRoot"`
Range sglsp.Range `json:"range"`
IsIgnored bool `json:"isIgnored"`
IsNew bool `json:"isNew"`
IgnoreDetails IgnoreDetails `json:"ignoreDetails"`
FilterableIssueType product.FilterableIssueType `json:"filterableIssueType,omitempty"`
AdditionalData any `json:"additionalData,omitempty"`
}
type ScanResultProcessor ¶ added in v1.1303.0
type ScanStatus ¶
type ScanStatus string
const ( InProgress ScanStatus = "inProgress" Success ScanStatus = "success" ErrorStatus ScanStatus = "error" )
type ScanSummary ¶ added in v1.1303.0
type ScanSummary struct {
ScanSummary string `json:"scanSummary"`
}
type Scanner ¶ added in v1.1303.0
type Scanner interface {
// Scan scans a workspace folder or file for issues, given its path. 'folderPath' provides a path to a workspace folder, if a file needs to be scanned.
Scan(ctx context.Context, path FilePath, processResults ScanResultProcessor, folderPath FilePath)
}
type ServerCapabilities ¶
type ServerCapabilities struct {
TextDocumentSync *sglsp.TextDocumentSyncOptionsOrKind `json:"textDocumentSync,omitempty"`
HoverProvider bool `json:"hoverProvider,omitempty"`
CompletionProvider *sglsp.CompletionOptions `json:"completionProvider,omitempty"`
SignatureHelpProvider *sglsp.SignatureHelpOptions `json:"signatureHelpProvider,omitempty"`
DefinitionProvider bool `json:"definitionProvider,omitempty"`
TypeDefinitionProvider bool `json:"typeDefinitionProvider,omitempty"`
ReferencesProvider bool `json:"referencesProvider,omitempty"`
DocumentHighlightProvider bool `json:"documentHighlightProvider,omitempty"`
DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"`
WorkspaceSymbolProvider bool `json:"workspaceSymbolProvider,omitempty"`
ImplementationProvider bool `json:"implementationProvider,omitempty"`
CodeActionProvider *CodeActionOptions `json:"codeActionProvider,omitempty"`
CodeLensProvider *sglsp.CodeLensOptions `json:"codeLensProvider,omitempty"`
DocumentFormattingProvider bool `json:"documentFormattingProvider,omitempty"`
DocumentRangeFormattingProvider bool `json:"documentRangeFormattingProvider,omitempty"`
DocumentOnTypeFormattingProvider *sglsp.DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"`
RenameProvider bool `json:"renameProvider,omitempty"`
ExecuteCommandProvider *sglsp.ExecuteCommandOptions `json:"executeCommandProvider,omitempty"`
SemanticHighlighting *sglsp.SemanticHighlightingOptions `json:"semanticHighlighting,omitempty"`
Workspace *WorkspaceCapabilities `json:"workspace,omitempty"`
InlineValueProvider bool `json:"inlineValueProvider,omitempty"`
}
type ServerInfo ¶
type Settings ¶
type Settings struct {
// Global settings start
ActivateSnykOpenSource string `json:"activateSnykOpenSource,omitempty"`
ActivateSnykCode string `json:"activateSnykCode,omitempty"`
ActivateSnykIac string `json:"activateSnykIac,omitempty"`
Insecure string `json:"insecure,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
CliBaseDownloadURL string `json:"cliBaseDownloadURL,omitempty"`
Organization *string `json:"organization,omitempty"`
Path string `json:"path,omitempty"`
CliPath string `json:"cliPath,omitempty"`
Token string `json:"token,omitempty"`
IntegrationName string `json:"integrationName,omitempty"`
IntegrationVersion string `json:"integrationVersion,omitempty"`
AutomaticAuthentication string `json:"automaticAuthentication,omitempty"`
DeviceId string `json:"deviceId,omitempty"`
FilterSeverity *SeverityFilter `json:"filterSeverity,omitempty"`
RiskScoreThreshold *int `json:"riskScoreThreshold,omitempty"` // Valid range is 0-1000.
IssueViewOptions *IssueViewOptions `json:"issueViewOptions,omitempty"`
SendErrorReports string `json:"sendErrorReports,omitempty"`
ManageBinariesAutomatically string `json:"manageBinariesAutomatically,omitempty"`
EnableTrustedFoldersFeature string `json:"enableTrustedFoldersFeature,omitempty"`
ActivateSnykCodeSecurity string `json:"activateSnykCodeSecurity,omitempty"`
ActivateSnykCodeQuality string `json:"activateSnykCodeQuality,omitempty"`
OsPlatform string `json:"osPlatform,omitempty"`
OsArch string `json:"osArch,omitempty"`
RuntimeVersion string `json:"runtimeVersion,omitempty"`
RuntimeName string `json:"runtimeName,omitempty"`
ScanningMode string `json:"scanningMode,omitempty"`
AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"`
SnykCodeApi string `json:"snykCodeApi,omitempty"`
EnableSnykLearnCodeActions string `json:"enableSnykLearnCodeActions,omitempty"`
EnableSnykOSSQuickFixCodeActions string `json:"enableSnykOSSQuickFixCodeActions,omitempty"`
EnableSnykOpenBrowserActions string `json:"enableSnykOpenBrowserActions,omitempty"`
EnableDeltaFindings string `json:"enableDeltaFindings,omitempty"` // should this be global?
RequiredProtocolVersion string `json:"requiredProtocolVersion,omitempty"`
HoverVerbosity *int `json:"hoverVerbosity,omitempty"`
OutputFormat *string `json:"outputFormat,omitempty"`
AutoConfigureSnykMcpServer string `json:"autoConfigureSnykMcpServer,omitempty"`
SecureAtInceptionExecutionFrequency string `json:"secureAtInceptionExecutionFrequency,omitempty"`
// Folder specific settings start
AdditionalParams string `json:"additionalParams,omitempty"` // TODO make folder specific, move to folder config
AdditionalEnv string `json:"additionalEnv,omitempty"` // Global fallback for backward compatibility; folder-specific values in FolderConfig.AdditionalEnv
TrustedFolders []string `json:"trustedFolders,omitempty"` // TODO make folder specific, move to folder config
FolderConfigs []FolderConfig `json:"folderConfigs,omitempty"`
}
Settings is the struct that is parsed from the InitializationParams.InitializationOptions field
type SeverityFilter ¶
type SeverityFilter struct {
Critical bool `json:"critical,omitempty"`
High bool `json:"high,omitempty"`
Medium bool `json:"medium,omitempty"`
Low bool `json:"low,omitempty"`
}
func DefaultSeverityFilter ¶
func DefaultSeverityFilter() SeverityFilter
func NewSeverityFilter ¶
func NewSeverityFilter(critical bool, high bool, medium bool, low bool) SeverityFilter
type SeverityIssueCounts ¶ added in v1.1303.0
type SeverityIssueCounts map[Severity]IssueCount
type ShowDocumentParams ¶
type ShowDocumentParams struct {
/**
* The document uri to show.
*/
Uri sglsp.DocumentURI `json:"uri"`
/**
* Indicates to show the resource in an external program.
* To show for example `https://code.visualstudio.com/`
* in the default WEB browser set `external` to `true`.
*/
External bool `json:"external"`
/**
* An optional property to indicate whether the editor
* showing the document should take focus or not.
* Clients might ignore this property if an external
* program is started.
*/
TakeFocus bool `json:"takeFocus"`
/**
* An optional selection range if the document is a text
* document. Clients might ignore the property if an
* external program is started or the file is not a text
* file.
*/
Selection sglsp.Range `json:"selection"`
}
*
- ShowDocumentParams defines specifics to show a document. *
- @since 3.16.0
type ShowMessageRequest ¶
type ShowMessageRequest struct {
Message string `json:"message"`
Type MessageType `json:"type"`
Actions *data_structure.OrderedMap[MessageAction, CommandData] `json:"actions"`
}
type ShowMessageRequestParams ¶
type ShowMessageRequestParams struct {
Type MessageType `json:"type"`
Message string `json:"message"`
Actions []MessageActionItem `json:"actions"`
}
type SnykIsAvailableCli ¶
type SnykIsAvailableCli struct {
CliPath string `json:"cliPath"`
}
type SnykRegisterMcpParams ¶ added in v1.1303.0
type SnykScanParams ¶
type SnykScanParams struct {
// Status can be either InProgress, Success or ErrorStatus
Status ScanStatus `json:"status"`
// Product under scan (Snyk Code, Snyk Open Source, etc...)
Product string `json:"product"`
// FolderPath is the root-folder of the current scan
FolderPath FilePath `json:"folderPath"`
// PresentableError structured error object for displaying it to the user
PresentableError *PresentableError `json:"presentableError,omitempty"`
}
SnykScanParams is the type for the $/snyk/scan message
type SnykTrustedFoldersParams ¶
type SnykTrustedFoldersParams struct {
TrustedFolders []FilePath `json:"trustedFolders"`
}
type TextDocumentClientCapabilities ¶
type TextDocumentClientCapabilities struct {
Declaration *struct {
LinkSupport bool `json:"linkSupport,omitempty"`
} `json:"declaration,omitempty"`
Definition *struct {
LinkSupport bool `json:"linkSupport,omitempty"`
} `json:"definition,omitempty"`
Implementation *struct {
LinkSupport bool `json:"linkSupport,omitempty"`
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"implementation,omitempty"`
TypeDefinition *struct {
LinkSupport bool `json:"linkSupport,omitempty"`
} `json:"typeDefinition,omitempty"`
Synchronization *struct {
WillSave bool `json:"willSave,omitempty"`
DidSave bool `json:"didSave,omitempty"`
WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`
} `json:"synchronization,omitempty"`
DocumentSymbol struct {
SymbolKind struct {
ValueSet []int `json:"valueSet,omitempty"`
} `json:"symbolKind,omitempty"`
HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"`
} `json:"documentSymbol,omitempty"`
Formatting *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"formatting,omitempty"`
RangeFormatting *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"rangeFormatting,omitempty"`
Rename *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
PrepareSupport bool `json:"prepareSupport,omitempty"`
} `json:"rename,omitempty"`
SemanticHighlightingCapabilities *struct {
SemanticHighlighting bool `json:"semanticHighlighting,omitempty"`
} `json:"semanticHighlightingCapabilities,omitempty"`
CodeAction struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
IsPreferredSupport bool `json:"isPreferredSupport,omitempty"`
CodeActionLiteralSupport struct {
CodeActionKind struct {
ValueSet []CodeActionKind `json:"valueSet,omitempty"`
} `json:"codeActionKind,omitempty"`
} `json:"codeActionLiteralSupport,omitempty"`
} `json:"codeAction,omitempty"`
Completion struct {
CompletionItem struct {
DocumentationFormat []DocumentationFormat `json:"documentationFormat,omitempty"`
SnippetSupport bool `json:"snippetSupport,omitempty"`
} `json:"completionItem,omitempty"`
CompletionItemKind struct {
ValueSet []CompletionItemKind `json:"valueSet,omitempty"`
} `json:"completionItemKind,omitempty"`
ContextSupport bool `json:"contextSupport,omitempty"`
} `json:"completion,omitempty"`
SignatureHelp *struct {
SignatureInformation struct {
ParameterInformation struct {
LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"`
} `json:"parameterInformation,omitempty"`
} `json:"signatureInformation,omitempty"`
} `json:"signatureHelp,omitempty"`
DocumentLink *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
TooltipSupport bool `json:"tooltipSupport,omitempty"`
} `json:"documentLink,omitempty"`
Hover *struct {
ContentFormat []string `json:"contentFormat,omitempty"`
} `json:"hover,omitempty"`
FoldingRange *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
RangeLimit interface{} `json:"rangeLimit,omitempty"`
LineFoldingOnly bool `json:"lineFoldingOnly,omitempty"`
} `json:"foldingRange,omitempty"`
CallHierarchy *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"callHierarchy,omitempty"`
ColorProvider *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"colorProvider,omitempty"`
/**
* Capabilities specific to the `textDocument/inlineValue` request.
*
* @since 3.17.0
*/
InlineValue *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"inlineValue,omitempty"`
}
type TextDocumentSaveReason ¶
type TextDocumentSaveReason int
const ( Manual TextDocumentSaveReason = 0 AfterDelay TextDocumentSaveReason = 1 FocusOut TextDocumentSaveReason = 2 )
type TrustRequester ¶
type TrustRequester interface {
StartRequestTrustCommunication()
EndRequestTrustCommunication()
IsTrustRequestOngoing() bool
}
type WillSaveTextDocumentParams ¶
type WillSaveTextDocumentParams struct {
TextDocument sglsp.TextDocumentIdentifier `json:"textDocument"`
Reason TextDocumentSaveReason `json:"reason"`
}
type WindowClientCapabilities ¶
type WindowClientCapabilities struct {
WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
}
type WorkDoneProgressBegin ¶
type WorkDoneProgressBegin struct {
WorkDoneProgressKind
/**
* Mandatory title of the progress operation. Used to briefly inform about
* the kind of operation being performed.
*
* Examples: "Indexing" or "Linking dependencies".
*/
Title string `json:"title"`
/**
* Controls if a cancel button should show to allow the user to cancel the
* long running operation. Clients that don't support cancellation are allowed
* to ignore the setting.
*/
Cancellable bool `json:"cancellable,omitempty"`
/**
* Optional, more detailed associated progress message. Contains
* complementary information to the `title`.
*
* Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
* If unset, the previous progress message (if any) is still valid.
*/
Message string `json:"message,omitempty"`
/**
* Optional progress percentage to display (value 100 is considered 100%).
* If not provided infinite progress is assumed and clients are allowed
* to ignore the `percentage` value in subsequent in report notifications.
*
* The value should be steadily rising. Clients are free to ignore values
* that are not following this rule. The value range is [0, 100].
*/
Percentage int `json:"percentage,omitempty"`
}
type WorkDoneProgressEnd ¶
type WorkDoneProgressEnd struct {
WorkDoneProgressKind
/**
* Optional, a final message indicating to for example indicate the outcome
* of the operation.
*/
Message string `json:"message,omitempty"`
}
type WorkDoneProgressKind ¶
type WorkDoneProgressKind struct {
Kind string `json:"kind"`
}
type WorkDoneProgressReport ¶
type WorkDoneProgressReport struct {
WorkDoneProgressKind
/**
* Controls enablement state of a cancel button.
*
* Clients that don't support cancellation or don't support controlling the button's
* enablement state are allowed to ignore the property.
*/
Cancellable bool `json:"cancellable,omitempty"`
/**
* Optional, more detailed associated progress message. Contains
* complementary information to the `title`.
*
* Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
* If unset, the previous progress message (if any) is still valid.
*/
Message string `json:"message,omitempty"`
/**
* Optional progress percentage to display (value 100 is considered 100%).
* If not provided infinite progress is assumed and clients are allowed
* to ignore the `percentage` value in subsequent in report notifications.
*
* The value should be steadily rising. Clients are free to ignore values
* that are not following this rule. The value range is [0, 100]
*/
Percentage int `json:"percentage,omitempty"`
}
type WorkdoneProgressCancelParams ¶
type WorkdoneProgressCancelParams struct {
Token ProgressToken `json:"token"`
}
type Workspace ¶
type Workspace interface {
Clearer
TrustRequester
GetScanSnapshotClearerExister() ScanSnapshotClearerExister
RemoveFolder(folderPath FilePath)
DeleteFile(filePath FilePath)
AddFolder(f Folder)
GetFolderContaining(path FilePath) Folder
Folders() (folder []Folder)
ScanWorkspace(ctx context.Context)
ChangeWorkspaceFolders(params DidChangeWorkspaceFoldersParams) []Folder
GetFolderTrust() (trusted []Folder, untrusted []Folder)
ClearIssuesByType(removedType product.FilterableIssueType)
TrustFoldersAndScan(ctx context.Context, foldersToBeTrusted []Folder)
HandleConfigChange()
}
type WorkspaceCapabilities ¶
type WorkspaceCapabilities struct {
WorkspaceFolders *WorkspaceFoldersServerCapabilities `json:"workspaceFolders,omitempty"`
FileOperations *FileOperationsServerCapabilities `json:"fileOperations,omitempty"`
}
type WorkspaceClientCapabilities ¶
type WorkspaceClientCapabilities struct {
WorkspaceEdit struct {
DocumentChanges bool `json:"documentChanges,omitempty"`
ResourceOperations []string `json:"resourceOperations,omitempty"`
} `json:"workspaceEdit,omitempty"`
ApplyEdit bool `json:"applyEdit,omitempty"`
Symbol struct {
SymbolKind struct {
ValueSet []int `json:"valueSet,omitempty"`
} `json:"symbolKind,omitempty"`
} `json:"symbol,omitempty"`
DidChangeWatchedFiles *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"didChangeWatchedFiles,omitempty"`
ExecuteCommand *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"executeCommand,omitempty"`
WorkspaceFolders bool `json:"workspaceFolders,omitempty"`
Configuration bool `json:"configuration,omitempty"`
CodeLens CodeLensWorkspaceClientCapabilities `json:"codeLens,omitempty"`
InlineValue InlineValueWorkspaceClientCapabilities `json:"inlineValue,omitempty"`
}
type WorkspaceEdit ¶ added in v1.1303.0
type WorkspaceFolder ¶
type WorkspaceFolder struct {
// The associated Uri for this workspace folder.
Uri sglsp.DocumentURI `json:"uri,omitempty"`
// The Name of the workspace folder. Used to refer to this
// workspace folder in the user interface.
Name string `json:"name,omitempty"`
}
type WorkspaceFoldersChangeEvent ¶
type WorkspaceFoldersChangeEvent struct {
// The array of Added workspace folders
Added []WorkspaceFolder `json:"Added,omitempty"`
// The array of the Removed workspace folders
Removed []WorkspaceFolder `json:"Removed,omitempty"`
}
WorkspaceFoldersChangeEvent The workspace folder change event.
type WorkspaceFoldersServerCapabilities ¶
type WorkspaceFoldersServerCapabilities struct {
/**
* The server has support for workspace folders
*/
Supported bool `json:"supported,omitempty"`
/**
* Whether the server wants to receive workspace folder
* change notifications.
*
* If a string is provided, the string is treated as an ID
* under which the notification is registered on the client
* side. The ID can be used to unregister for these events
* using the `client/unregisterCapability` request.
*/
ChangeNotifications string `json:"changeNotifications,omitempty"`
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_types is a generated GoMock package.
|
Package mock_types is a generated GoMock package. |