1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:28:32 -06:00

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>
This commit is contained in:
Peter Weinberger 2019-05-13 12:27:26 -04:00
parent 99f201b680
commit 8696927a28
3 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,6 @@
package protocol
//automatically generated
// Code generated (see typescript/README.md) DO NOT EDIT.
import (
"context"

View File

@ -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 {

View File

@ -1,6 +1,6 @@
package protocol
//automatically generated
// Code generated (see typescript/README.md) DO NOT EDIT.
import (
"context"
@ -253,7 +253,8 @@ func serverHandler(log xlog.Logger, server Server) jsonrpc2.Handler {
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