internal/lsp: respond to shutdown requests and add DO NOT EDITs
Partly fixes golang/go#31333 (responds to shutdown request, but does
not reject later requests)
Fixes: golang/go#31375 by adding DO NOT EDIT comments to tsclient.go,
tsserver.go, and further details in the package doc in tsprotocol.go,
following the rule in golang/go#13560
Change-Id: I412e3dc6661373b8b70cdd15a385ad7bbd55a897
Reviewed-on: https://go-review.googlesource.com/c/tools/+/176921
Run-TryBot: Peter Weinberger <pjw@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/internal/lsp/protocol/tsclient.go b/internal/lsp/protocol/tsclient.go
index 71d6c11..b92f01c 100644
--- a/internal/lsp/protocol/tsclient.go
+++ b/internal/lsp/protocol/tsclient.go
@@ -1,6 +1,6 @@
package protocol
-//automatically generated
+// Code generated (see typescript/README.md) DO NOT EDIT.
import (
"context"
diff --git a/internal/lsp/protocol/tsprotocol.go b/internal/lsp/protocol/tsprotocol.go
index 62afa96..e18587e 100644
--- a/internal/lsp/protocol/tsprotocol.go
+++ b/internal/lsp/protocol/tsprotocol.go
@@ -1,8 +1,11 @@
-// Package protocol contains data types for LSP jsonrpcs
+// Package protocol contains data types and code for LSP jsonrpcs
// generated automatically from vscode-languageserver-node
-// version of Fri Apr 05 2019 10:16:07 GMT-0400 (Eastern Daylight Time)
+// commit: 54f6caacea8aa0cf9f45527153d993010c1cc793
+// last fetched Fri Apr 05 2019 10:16:07 GMT-0400 (Eastern Daylight Time)
package protocol
+// Code generated (see typescript/README.md) DO NOT EDIT.
+
// WorkspaceFolder is
type WorkspaceFolder struct {
diff --git a/internal/lsp/protocol/tsserver.go b/internal/lsp/protocol/tsserver.go
index e756b79..3d53000 100644
--- a/internal/lsp/protocol/tsserver.go
+++ b/internal/lsp/protocol/tsserver.go
@@ -1,6 +1,6 @@
package protocol
-//automatically generated
+// Code generated (see typescript/README.md) DO NOT EDIT.
import (
"context"
@@ -253,7 +253,8 @@
conn.Reply(ctx, r, nil, jsonrpc2.NewErrorf(jsonrpc2.CodeInvalidParams, "Expected no params"))
return
}
- if err := server.Shutdown(ctx); err != nil {
+ err := server.Shutdown(ctx)
+ if err := conn.Reply(ctx, r, nil, err); err != nil {
log.Errorf(ctx, "%v", err)
}
case "textDocument/willSaveWaitUntil": // req