all: merge master (ee20ddf) into gopls-release-branch.0.14

Also add back the replace directive, and tidy.

For golang/go#63220

Conflicts:

- gopls/go.sum

Merge List:

+ 2023-10-05 ee20ddf1f internal/refactor/inline: permit return conversions in tailcall
+ 2023-10-05 db1d1e0d3 gopls/internal/lsp: go to definition from embed directive
+ 2023-10-05 2be977ecc internal/refactor/inline: work around channel type misformatting
+ 2023-10-04 0ba9c8439 internal/fuzzy: several improvements for symbol matching
+ 2023-10-04 c2725ad84 gopls: update x/telemetry dependency
+ 2023-10-03 e8722c010 go/types/internal/play: show types.Selection information
+ 2023-10-03 a819c616c internal/refactor/inline: eliminate unnecessary binding decl
+ 2023-10-03 102b64b54 internal/refactor/inline: tweak everything-test docs again
+ 2023-10-03 197e2c432 internal/refactor/inline: fix broken tests
+ 2023-10-03 586b21ae0 internal/refactor/inline: elide redundant braces
+ 2023-10-02 ca34416d4 internal/refactor/inline: fallible constant analysis
+ 2023-10-02 6a38a5f6f internal/refactor/inline: use default working directory
+ 2023-10-02 c6d331deb internal/refactor/inline: don't add same import PkgName twice
+ 2023-10-02 1058109b6 internal/refactor/inline: don't insert unnecessary parens
+ 2023-10-02 d8e94f203 internal/refactor/inline: fix bug in shadow detection
+ 2023-10-02 0adbf9c67 gopls/internal/lsp: simplify the telemetry prompt
+ 2023-10-02 2ed429843 go/analysis/analysistest: format golden files before comparing
+ 2023-09-28 451716b51 internal/refactor/inline: consider "", 0.0, 1.0 duplicable
+ 2023-09-28 792f91f70 internal/refactor/inline: tweak everything test for cgo
+ 2023-09-28 941629930 internal/refactor/inline: fix pkgname shadowing bug
+ 2023-09-28 4cd12d6da gopls/internal/lsp/fake: don't set a completion budget for tests
+ 2023-09-28 57ecf488e gopls/internal/lsp: hover over embed directives
+ 2023-09-28 6de34480a gopls/internal/lsp/cache: remove snapshot.typeCheckMu
+ 2023-09-27 7f23bc81d gopls/internal/regtest/source/completion: reuse functionCallSnippet in unimported completion
+ 2023-09-27 3d03fbd05 gopls/internal/lsp: use matcher score in ranking unimported candidates
+ 2023-09-27 7577387a8 gopls/internal/lsp/source: don't complete to golang.org/toolchain
+ 2023-09-27 4b34fbf5f internal/refactor/inline: fix bug discard receiver and spread
+ 2023-09-27 6ec9b0f07 internal/refactor/inline: refine "last ref to caller local"
+ 2023-09-27 08bdfeca0 internal/refactor/inline: split up the big table
+ 2023-09-27 486787ef4 gopls/internal/lsp/source: Add ui.complete.completeFunctionCalls toggle
+ 2023-09-27 9d2d0e853 gopls: set a context deadline after minimal completion results
+ 2023-09-26 169105a90 internal/refactor/inline: insert conversions during substitution
+ 2023-09-26 b3ada30db internal/refactor/inline: analyze callee effects
+ 2023-09-26 160210312 internal/refactor/inline: skip cgo tests on non-cgo builders
+ 2023-09-26 1c8e684dd internal/refactor/inline: sound treatment of named results
+ 2023-09-26 d32f97a6d internal/refactor/inline: eliminate Callee.BodyIsReturnExpr
+ 2023-09-26 f4abeaefa go/analysis/passes/directive: use strings.Cut
+ 2023-09-26 c42ed47c5 internal/refactor/inline: reject attempts to inline in cgo code
+ 2023-09-26 313150aa0 internal/refactor/inline: x++ counts as assignment in escape
+ 2023-09-26 d6f1bb710 internal/refactor/inline: ignore line directives in testing

Change-Id: I97157c76bd781c03aef407b86ac1da209846f99a
tree: e444f66c200167c6889cd4c1eba8104586b2fb4c
  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.