File tree Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2021 The Go Language Server Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package protocol
6
+
7
+ import "go.lsp.dev/jsonrpc2"
8
+
9
+ const (
10
+ // ContentModified is the state change that invalidates the result of a request in execution.
11
+ //
12
+ // Defined by the protocol.
13
+ CodeContentModified jsonrpc2.Code = - 32801
14
+
15
+ // RequestCancelled is the cancellation error.
16
+ //
17
+ // Defined by the protocol.
18
+ CodeRequestCancelled jsonrpc2.Code = - 32800
19
+ )
20
+
21
+ var (
22
+ // ErrContentModified should be used when a request is canceled early.
23
+ ErrContentModified = jsonrpc2 .NewError (CodeContentModified , "cancelled JSON-RPC" )
24
+
25
+ // ErrRequestCancelled should be used when a request is canceled early.
26
+ ErrRequestCancelled = jsonrpc2 .NewError (CodeRequestCancelled , "cancelled JSON-RPC" )
27
+ )
Original file line number Diff line number Diff line change @@ -12,12 +12,6 @@ import (
12
12
"go.lsp.dev/pkg/xcontext"
13
13
)
14
14
15
- // RequestCancelledCode cancel request code.
16
- const RequestCancelledCode jsonrpc2.Code = - 32800
17
-
18
- // ErrRequestCancelled should be used when a request is canceled early.
19
- var ErrRequestCancelled = jsonrpc2 .NewError (RequestCancelledCode , "cancelled JSON-RPC" )
20
-
21
15
// Handlers default jsonrpc2.Handler.
22
16
func Handlers (handler jsonrpc2.Handler ) jsonrpc2.Handler {
23
17
return CancelHandler (
You can’t perform that action at this time.
0 commit comments