commit | f2e330f49058f692e942445a77c6ee5ab1ca879b | [log] [tgz] |
---|---|---|
author | Peter Weinbergr <pjw@google.com> | Fri Dec 11 08:34:53 2020 -0500 |
committer | Peter Weinberger <pjw@google.com> | Tue Dec 22 16:32:15 2020 +0000 |
tree | 139ecb954c8af33685dc7508498150593dcfb38c | |
parent | 1965356128881de7178c4c0a1cbeb15035659dea [diff] |
gopls/test: add type checking for debug server templates When internal data structures in gopls changed, the templates driving the debug server failed because fields or methods they relied on had gone away. At some cost, this change adds tests that all the fields and methods in the templates can be satisfied. The test assumes that all the template uses are through render() in debug/serve.go. It checks that is list of templates is the same as the server's, and then type checks each template. The costs are 1. the template type checking is done by a new external dependency, github.com/jba/templatecheck 2. To avoid adding a new dependency to x/tools, the test is in the gopls module, not the debug package, so variables from the debug package have to be exported In an ideal world the debug package, and much of internal/lsp, would be in the gopls package. In that case the cost 2 about could be avoided. In an ideal world, the core runtime template packages would contain template checking code, and cost 1 would be unnecessary. In a more likely (or not so distant) world, perhaps jba would move (or allow us to move) the template check package into x/tools. Change-Id: I36b509a00cbdcb5323ee1af3c1193b603c7a907f Reviewed-on: https://go-review.googlesource.com/c/tools/+/277292 Run-TryBot: Peter Weinberger <pjw@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org> Trust: Peter Weinberger <pjw@google.com>
This subrepository holds the source for various packages and tools that support the Go programming language.
Some of the tools, godoc
and vet
for example, are included in binary Go distributions.
Others, including the Go guru
and the test coverage tool, can be fetched with go get
.
Packages include a type-checker for Go and an implementation of the Static Single Assignment form (SSA) representation for Go programs.
The easiest way to install is to run go get -u golang.org/x/tools/...
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/tools
.
This repository uses prettier to format JS and CSS files.
The version of prettier
used is 1.18.2.
It is encouraged that all JS and CSS code be run through this before submitting a change. However, it is not a strict requirement enforced by CI.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the tools repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/tools/(your subdir):” in the subject line, so it is easy to find.