Skip to content

Commit cd3ceb5

Browse files
committed
capabilities_client: move FailureHandlingKind to capabilities_client
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 860a656 commit cd3ceb5

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

capabilities_client.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ type WorkspaceClientCapabilitiesWorkspaceEdit struct {
9191

9292
// FailureHandling is the failure handling strategy of a client if applying the workspace edit
9393
// fails.
94+
//
95+
// Mostly FailureHandlingKind.
9496
FailureHandling string `json:"failureHandling,omitempty"`
9597

9698
// ResourceOperations is the resource operations the client supports. Clients should at least
@@ -112,6 +114,28 @@ type WorkspaceClientCapabilitiesWorkspaceEdit struct {
112114
ChangeAnnotationSupport *WorkspaceClientCapabilitiesWorkspaceEditChangeAnnotationSupport `json:"changeAnnotationSupport,omitempty"`
113115
}
114116

117+
// FailureHandlingKind is the kind of failure handling .
118+
type FailureHandlingKind string
119+
120+
const (
121+
// FailureHandlingKindAbort applying the workspace change is simply aborted if one of the changes provided
122+
// fails. All operations executed before the failing operation stay executed.
123+
FailureHandlingKindAbort FailureHandlingKind = "abort"
124+
125+
// FailureHandlingKindTransactional all operations are executed transactional. That means they either all
126+
// succeed or no changes at all are applied to the workspace.
127+
FailureHandlingKindTransactional FailureHandlingKind = "transactional"
128+
129+
// FailureHandlingKindTextOnlyTransactional if the workspace edit contains only textual file changes they are executed transactional.
130+
// If resource changes (create, rename or delete file) are part of the change the failure
131+
// handling strategy is abort.
132+
FailureHandlingKindTextOnlyTransactional FailureHandlingKind = "textOnlyTransactional"
133+
134+
// FailureHandlingKindUndo the client tries to undo the operations already executed. But there is no
135+
// guarantee that this is succeeding.
136+
FailureHandlingKindUndo FailureHandlingKind = "undo"
137+
)
138+
115139
// WorkspaceClientCapabilitiesWorkspaceEditChangeAnnotationSupport is the ChangeAnnotationSupport of WorkspaceClientCapabilitiesWorkspaceEdit.
116140
//
117141
// @since 3.16.0.

general.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -760,27 +760,5 @@ type DocumentLinkRegistrationOptions struct {
760760
// InitializedParams params of Initialized Notification.
761761
type InitializedParams struct{}
762762

763-
// FailureHandlingKind is the kind of failure handling .
764-
type FailureHandlingKind string
765-
766-
const (
767-
// Abort applying the workspace change is simply aborted if one of the changes provided
768-
// fails. All operations executed before the failing operation stay executed.
769-
Abort FailureHandlingKind = "abort"
770-
771-
// Transactional all operations are executed transactional. That means they either all
772-
// succeed or no changes at all are applied to the workspace.
773-
Transactional FailureHandlingKind = "transactional"
774-
775-
// TextOnlyTransactional if the workspace edit contains only textual file changes they are executed transactional.
776-
// If resource changes (create, rename or delete file) are part of the change the failure
777-
// handling strategy is abort.
778-
TextOnlyTransactional FailureHandlingKind = "textOnlyTransactional"
779-
780-
// Undo the client tries to undo the operations already executed. But there is no
781-
// guarantee that this is succeeding.
782-
Undo FailureHandlingKind = "undo"
783-
)
784-
785763
// WorkspaceFolders represents a slice of WorkspaceFolder.
786764
type WorkspaceFolders []WorkspaceFolder

0 commit comments

Comments
 (0)