1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:48:32 -06:00
go/internal/lsp/cmd
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
..
test internal/lsp/source: add support for references in the same workspace 2019-11-14 20:04:27 +00:00
check.go internal/lsp: use x/xerrors to create new errors 2019-08-06 19:46:56 +00:00
cmd_test.go internal/lsp: use options hooks to install diff driver 2019-10-11 16:38:31 +00:00
cmd.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
definition.go internal/lsp: show errors when the user is in the wrong directory 2019-09-17 21:41:55 +00:00
export_test.go internal/lsp: refactor query definition test to allow adding a new test 2019-03-18 20:06:54 +00:00
folding_range.go tools/gopls: add cmd support for folding_ranges 2019-11-12 00:55:09 +00:00
format.go internal/lsp: address staticcheck warnings 2019-10-04 02:16:23 +00:00
imports.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
info.go internal/lsp: move PrintVersionInfo to the debug package 2019-06-03 15:29:06 +00:00
links.go tools/gopls: add command line support for links 2019-11-01 17:18:15 +00:00
query.go tools/internal/tool: refactor tool.Main() for testabilty 2019-09-19 22:27:22 +00:00
references.go internal/lsp/source: add support for references in the same workspace 2019-11-14 20:04:27 +00:00
rename.go internal/lsp: use versioned URIs in rename and code actions 2019-11-13 05:52:40 +00:00
serve.go internal/lsp: restore the rpc metrics 2019-11-04 23:16:39 +00:00
signature.go tools/gopls: add cmd support for signature 2019-10-31 22:07:37 +00:00
suggested_fix.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
symbols.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00