1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:44:42 -07:00
go/internal/lsp
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
..
browser internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
cache internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
cmd internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
debug internal/lsp: fix the debug info pages 2019-11-04 23:16:26 +00:00
diff internal/lsp: fix unified diffs of edits at the end of a file 2019-10-11 16:38:14 +00:00
fuzzy internal/lsp: fix fuzzy matcher inconsistency 2019-10-22 21:05:28 +00:00
protocol internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
snippet all: fix broken links to LSP specification 2019-10-02 18:32:53 +00:00
source internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
telemetry internal/lsp: call load in (*session).NewView 2019-11-07 23:34:59 +00:00
testdata internal/lsp: fix variadic interface completion ranking 2019-11-18 05:14:29 +00:00
tests internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
code_action.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
command.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
completion_test.go internal/lsp: fix variadic interface completion ranking 2019-11-18 05:14:29 +00:00
completion.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
definition.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
diagnostics.go go/analysis, internal/lsp: add support for related information 2019-10-21 19:00:55 +00:00
folding_range.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
format.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
general.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
highlight.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
hover.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
implementation.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
link.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
lsp_test.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
references.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
rename.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
reset_golden.sh internal/lsp: fix regeneration of golden files 2019-09-25 13:16:59 +00:00
server.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
signature_help.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
symbols.go internal/lsp: fix panic in bestView 2019-11-16 21:44:31 +00:00
text_synchronization.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
watched_files.go internal/lsp/cache: add finer-grained control of file changes 2019-11-14 16:11:15 +00:00
workspace.go internal/lsp: handle the didChangeConfiguration message 2019-11-12 16:15:42 +00:00