all: merge master (743372f) into gopls-release-branch.0.12

For golang/go#59818

Conflicts:

- gopls/go.sum

Merge List:

+ 2023-05-16 743372f58 gopls/internal/lsp/debug: limit to 100 recent trace entries
+ 2023-05-16 522243a71 go/ssa/interp: avoid hard-coding GOOS and GOARCH
+ 2023-05-16 a0593829f gopls/internal/lsp/cache: fail workspace load on context cancellation
+ 2023-05-16 e5c8d4db7 gopls/internal/lsp/cache: unexport ValidBuildConfiguration
+ 2023-05-16 f4e8a711a go/ssa: use core type for composite literal addresses
+ 2023-05-16 3b25dbddd go/ssa: use core types for array length
+ 2023-05-16 e7048d518 gopls/internal/lsp/filecache: front with a 100MB in-memory LRU cache
+ 2023-05-16 8c0fcd2c6 gopls/internal/lsp/lru: extract LRU logic to a standalone package
+ 2023-05-16 19d700c67 go/ssa/interp: use the actual GOOS and GOARCH to interpret tests
+ 2023-05-16 9dcd3d5dc gopls/internal/lsp/filecache: limit Get parallelism too
+ 2023-05-16 7f203f0c3 go/ssa: consolidate use of underlying pointer
+ 2023-05-15 a13793e31 gopls/internal/lsp: add quick-fixes to manage the go.work file
+ 2023-05-15 12a0517ad internal/gcimporter: improve error handling
+ 2023-05-15 5eb1eb932 gopls/internal/lsp/cache: call filecache.Set asynchronously
+ 2023-05-15 35fe77a6b gopls/internal/lsp/filecache: limit parallelism in Set
+ 2023-05-12 1c9fe3f82 gopls: improve diagnostics for orphaned files
+ 2023-05-12 ad74ff634 go/gcexportdata: drop support for the ancient binary format
+ 2023-05-11 01128f9fb gopls/internal/lsp/source: fix bug renaming field to unexported
+ 2023-05-11 cd39d2be4 internal/lsp/cache: support loading multiple orphaned files
+ 2023-05-11 abeba28e7 gopls/internal/regtest/marker: support proxy files in marker tests
+ 2023-05-11 18186f0c6 go/analysis/passes/slog: simplify function matching
+ 2023-05-11 9aa9d134d cmd/bisect, internal/bisect: use more precise skip suffixes, written in hex
+ 2023-05-11 3034d9c3a gopls/internal/lsp/cmd: append, don't overwrite, in PublishDiagnostics
+ 2023-05-10 4318d630d gopls: change the default value of "symbolScope" to "all"
+ 2023-05-10 f44f50e39 gopls/internal/lsp/source: implementation: report builtin 'error'
+ 2023-05-10 787e7207e gopls/internal/lsp: optimize checks for ignored files
+ 2023-05-10 4ed7de18d gopls: add google-cloud-go as a benchmark repo
+ 2023-05-10 d799eba7d gopls: additional instrumentation during goimports
+ 2023-05-10 a7e7dc44c go/ssa: rename test cases in TestGenericBodies
+ 2023-05-10 d668f586c gopls/internal/regtest/marker: require cgo for issue59944.txt
+ 2023-05-10 005fa64ff go/analysis/passes/slog: add check for slog.Group
+ 2023-05-09 033e628ac go/ssa: more reindentation of TestGenericBodies
+ 2023-05-09 231084894 go/ssa: reindent test cases in TestGenericBodies
+ 2023-05-09 90e9c6599 gopls/internal/lsp/cache: skip type errors after parse errors
+ 2023-05-09 08b24db43 gopls/internal/lsp/regtest: check for "// @marker" rogue space
+ 2023-05-09 b9c20f65e gopls/internal/regtest/marker: migrate @diag to new marker tests
+ 2023-05-09 4609d79b0 cmd/bisect: add -compile and -godebug shorthands
+ 2023-05-09 ddfa2200a internal/fuzzy: improvements to the symbol scoring algorithm
+ 2023-05-09 344924276 go/types/objectpath: don't panic when receiver is missing a method
+ 2023-05-08 0809ec2e4 gopls/internal/lsp/source: document {All,Workspace}Metadata
+ 2023-05-08 8f7fb01dd go/analysis/unitchecker: add test of go vet on std
+ 2023-05-08 23e52a3e1 bisect: diagnose bad targets better
+ 2023-05-08 d5af8894f gopls: set GOWORK=off for loads from debug and safetoken tests
+ 2023-05-08 c93329a94 go/analysis/passes/printf: reshorten diagnostic about %s in Println call
+ 2023-05-08 62197261c go.mod: update golang.org/x dependencies
+ 2023-05-08 f4d143ebc go/ssa: cleanup TestGenericBodies to pickup package name
+ 2023-05-08 3d99ebe9f gopls/diff/unified: remove redundant information
+ 2023-05-05 479f5c690 go/ssa: Origin is only available after building
+ 2023-05-05 6d1dd1267 go/analysis: simplify unusedresult
+ 2023-05-05 4a2dd0d22 go/callgraph/vta: allow pointer to type parameter in sliceArrayElem
+ 2023-05-05 7c6c2b7f7 go/ssa: keep syntax for instantiations
+ 2023-05-05 ce1b96b59 all: fix some comments
+ 2023-05-05 0500fd459 go/ssa: use core type in address
+ 2023-05-05 8e9b1853d gopls/internal/lsp/source: add the "symbolScope" option
+ 2023-05-05 4ac71c005 internal/imports: sort fixes for deterministic results
+ 2023-05-05 573915d85 gopls/internal/lsp/cache: always init the resolver in runProcessEnvFunc
+ 2023-05-05 dd0938175 bisect: move to internal/bisect until API is reviewed
+ 2023-05-05 516063ad6 bisect, cmd/bisect: add new library and tool
+ 2023-05-05 58fedf60c internal/diffp: add patience diff from main repo
+ 2023-05-04 7b684a9a8 gopls: port import tests to the new marker framework
+ 2023-05-04 87974e327 gopls/internal/lsp/filecache: skip TestConcurrency on plan9 builder
+ 2023-05-04 c64bb76ef gopls/internal/lsp/source: make infertypeargs a convenience analyzer
+ 2023-05-04 91b7a8edf go/ssa: use origin method in source lookup
+ 2023-05-03 ba892bba5 go/types/internal/play: show formatted AST
+ 2023-05-03 7df6af86e gopls/internal/lsp/filecache: silently discard CRC errors on macOS
+ 2023-05-02 2563079e1 go/analysis/passes/printf: update directive diagnostic message
+ 2023-05-02 3f6c3b33c gopls: upgrade to latest version of LSP protocol
+ 2023-05-02 216928d1c gopls: port function extraction marker tests to the new framework
+ 2023-05-02 2415ce159 gopls: skip tests that load gopls packages if x/tools replacement is missing
+ 2023-05-02 17e5ef3c9 gopls/internal/lsp/cache: remove cycle check from buildMetadata
+ 2023-05-02 affb5fc1a gopls/internal/lsp/source: fix crash in definitions of builtins
+ 2023-05-02 558d7011f gopls/internal/lsp/source: fix another bug in reference expansion
+ 2023-05-01 51dfad7f4 gopls: port workspace/symbol marker tests to the new framework
+ 2023-05-01 c6b5780e5 gopls: fix build at older Go versions
+ 2023-05-01 7590fe4de gopls/internal/lsp: hover over linkname directives.
+ 2023-05-01 ec61ad324 gopls/internal/lsp/source: add invert-if-condition refactoring
+ 2023-04-28 5283a0178 go/packages: delete TestCgoOption as it doesn't test the cgo option
+ 2023-04-28 e2f3b2509 gopls/internal/bug: record bug reports in file cache
+ 2023-04-28 ab24b7b9e gopls/internal/regtest/marker: add a test case for issue #59554
+ 2023-04-28 8235df3e0 gopls/internal/regtest/marker: port format tests to the new framework
+ 2023-04-28 80dc03199 internal/diff: unified: match diff delete for empty file
+ 2023-04-27 165099bd7 all: remove repeated definite articles
+ 2023-04-27 ac40903ee internal/gocommand: simplify GoVersion invocation
+ 2023-04-27 9e0a7b105 copyright: don't require checkout to be named tools
+ 2023-04-26 94ed378f9 internal/lsp/testdata: update for new diagnostic from go list
+ 2023-04-26 a5c37ba21 gopls/internal/regtest/marker: skip on small machines
+ 2023-04-25 76e1037d7 internal/testenv: assume that mobile platforms are small machines
+ 2023-04-25 17e2d7055 gopls/internal/bug: remove unused Data parameter
+ 2023-04-25 dd89a2eb9 gopls/internal/lsp: remove now redundant debouncing logic
+ 2023-04-25 2a9398d92 go/analysis/passes/slog: do not report multiple incorrect keys
+ 2023-04-25 4baa3dc48 gopls/internal/bug: move bug package into gopls

Change-Id: I4cb08fe593bbc00102dbd266ad4ef1b6a1150e08
tree: a8d3b3908193300b58dc41d62b9622797cb98a5c
  1. benchmark/
  2. blog/
  3. cmd/
  4. container/
  5. copyright/
  6. cover/
  7. go/
  8. godoc/
  9. gopls/
  10. imports/
  11. internal/
  12. playground/
  13. present/
  14. refactor/
  15. txtar/
  16. .gitattributes
  17. .gitignore
  18. .prettierrc
  19. codereview.cfg
  20. CONTRIBUTING.md
  21. go.mod
  22. go.sum
  23. LICENSE
  24. PATENTS
  25. README.md
README.md

Go Tools

PkgGoDev

This repository provides the golang.org/x/tools module, comprising various tools and packages mostly for static analysis of Go programs, some of which are listed below. Use the “Go reference” link above for more information about any package.

It also contains the golang.org/x/tools/gopls module, whose root package is a language-server protocol (LSP) server for Go. An LSP server analyses the source code of a project and responds to requests from a wide range of editors such as VSCode and Vim, allowing them to support IDE-like functionality.

Selected commands:

  • cmd/goimports formats a Go program like go fmt and additionally inserts import statements for any packages required by the file after it is edited.
  • cmd/callgraph prints the call graph of a Go program.
  • cmd/digraph is a utility for manipulating directed graphs in textual notation.
  • cmd/stringer generates declarations (including a String method) for “enum” types.
  • cmd/toolstash is a utility to simplify working with multiple versions of the Go toolchain.

These commands may be fetched with a command such as

go install golang.org/x/tools/cmd/goimports@latest

Selected packages:

  • go/ssa provides a static single-assignment form (SSA) intermediate representation (IR) for Go programs, similar to a typical compiler, for use by analysis tools.

  • go/packages provides a simple interface for loading, parsing, and type checking a complete Go program from source code.

  • go/analysis provides a framework for modular static analysis of Go programs.

  • go/callgraph provides call graphs of Go programs using a variety of algorithms with different trade-offs.

  • go/ast/inspector provides an optimized means of traversing a Go parse tree for use in analysis tools.

  • go/cfg provides a simple control-flow graph (CFG) for a Go function.

  • go/expect reads Go source files used as test inputs and interprets special comments within them as queries or assertions for testing.

  • go/gcexportdata and go/gccgoexportdata read and write the binary files containing type information used by the standard and gccgo compilers.

  • go/types/objectpath provides a stable naming scheme for named entities (“objects”) in the go/types API.

Numerous other packages provide more esoteric functionality.

Contributing

This repository uses Gerrit for code changes. To learn how to submit changes, 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.

JavaScript and CSS Formatting

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.