1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:38:33 -06:00
go/internal/lsp/protocol
pjw 5091d647ee internal/lsp: reorganize the generated Go code for the lsp protocol
Code generation has been unified, so that tsprotocol.go and tsserver.go
are produced by the same program. tsprotocol.go is about 900 lines shorter,
partly from removing boilerplate comments that golint no longer requires.
(And partly by generating fewer unneeded types.)

The choice made for a union type is commented with the set of types. There
is no Go equivalent for union types, but making themn all interface{}
would replace type checking at unmarshalling with checking runtime
conversions.

Intersection types (A&B) are sometimes embedded (struct{A;B;}, and
sometimes expanded, as they have to be if A and B have fields with the
same names.

There are fewer embedded structs, which had been verbose and confusing to
initialize. They have been replaced by types whose names end in Gn.

Essentially all the generated *structs have been removed. This makes
no difference in what the client sends, and the server may send a {}
where it previously might have sent nothing. The benefit is that some
nil tests can be removed. Thus 'omitempty' in json tags is just
documentation that the element is optional in the protocol.

The files that generate this code will be submitted later, but soon.

Change-Id: I52b997d9c58de3d733fc8c6ce061e47ce2bdb100
Reviewed-on: https://go-review.googlesource.com/c/tools/+/207598
Run-TryBot: Peter Weinberger <pjw@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-11-18 19:51:19 +00:00
..
typescript lsp/protocol/typescript: add instructions for typescript compiling 2019-11-13 18:38:21 +00:00
context.go internal/telemetry: add the ability to flush telemetry data 2019-08-21 16:29:56 +00:00
doc.go internal/lsp: the core lsp protocol 2018-09-25 15:17:08 +00:00
enums.go internal/lsp: remove duplicated enums 2019-09-25 15:30:23 +00:00
log.go internal/lsp: fix lsp trace log format for gopls 2019-10-16 17:14:07 +00:00
protocol.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
span.go internal/lsp: reduce usage of column mapper 2019-09-16 22:00:07 +00:00
tsclient.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
tsprotocol.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
tsserver.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00