all: merge master (a297bfd) into gopls-release-branch.0.15

For golang/go#64973

Conflicts:

- gopls/go.mod
- gopls/go.sum

Merge List:

+ 2024-02-06 a297bfd98 go/callgraph/rta: audit for types.Alias safety
+ 2024-02-06 08393e066 cmd/deadcode: audit for types.Alias safety
+ 2024-02-06 37586e4e3 internal/apidiff: audit for types.Alias safety
+ 2024-02-06 6d4ccf2ad gopls/internal/cache: prime goimports cache asynchronously
+ 2024-02-06 8b6359d83 gopls/internal/cache: share goimports state for GOMODCACHE
+ 2024-02-06 2bb7f1c0c gopls/internal/test/integration/bench: improve completion benchmarks
+ 2024-02-06 f6dc1e9b7 internal/imports: merge init and newModuleResolver
+ 2024-02-06 4f6024ea3 internal/gopathwalk: walk directories concurrently
+ 2024-02-06 8fcb5f023 gopls/internal/test/marker: skip on LUCI solaris builders
+ 2024-02-06 08bd7281e gopls/internal/test/integration: add a test for an inner go.work file
+ 2024-02-06 aee2e7643 gopls/internal/settings: deprecate "allowModfileModifications"
+ 2024-02-05 ddb71b012 gopls/internal/cache: remove findWorkspaceModFile
+ 2024-02-05 365517a55 gopls/internal/cache: detect and reinit on workspace vendor changes
+ 2024-02-05 0be034b1e internal/aliases: Adds an internal alias package.
+ 2024-02-05 8efa10c95 internal/imports: add a benchmark for the initial mod cache scan
+ 2024-02-05 df03d7d47 gopls/internal/golang: add missing check for nil funcBody
+ 2024-02-03 a1fbc781c gopls/internal/golang: move Go semantic tokens out of server
+ 2024-02-03 51e3724fe gopls: remove unused parameters
+ 2024-02-03 d6bd2d74f gopls/internal/cache: add assertions for export data inconsistency
+ 2024-02-02 3403ce104 go/internal/gccgoimporter: recognize "any" as a builtin type
+ 2024-02-02 aecdb2d3f gopls/internal/cache: support workspace vendoring
+ 2024-02-02 e80085c40 gopls/internal/golang: downgrade bug.Reportf for missing builtin
+ 2024-02-02 9c4380303 gopls/internal/cache: allow command-line-package >1 CompileGoFiles
+ 2024-02-02 efce0f596 gopls/internal/cache/metadata: assert graph is acyclic
+ 2024-02-02 c3f60b787 gopls/internal/golang: hover: show embedded fields
+ 2024-02-02 85146f5b4 gopls/internal/lsp/source: highlight returns correctly
+ 2024-02-02 e211e0f09 gopls: enable crashmonitor for unexpected crashes
+ 2024-02-01 d07788857 gopls: update third party dependencies
+ 2024-02-01 2e15dc7cd gopls/internal/test/marker: reject "module testdata"
+ 2024-02-01 c07f92765 cmd/deadcode: enable crash reporting
+ 2024-02-01 44aed241f gopls/internal/analysis/undeclaredname: improve fix name
+ 2024-02-01 afe526599 go/packages: wait for sizes goroutine on all control paths
+ 2024-02-01 425078335 refactor/eg: don't use cgo in Test
+ 2024-02-01 1efbdde36 cmd/stringer, go/loader: use testenv.NeedsTool(t, "cgo")
+ 2024-01-31 5f9069195 go/buildutil: permit comma delimiters in build tags
+ 2024-01-31 0c80ba376 internal/imports: remove the unused ProcessEnv.ModFile field
+ 2024-01-31 c046c5b69 gopls/internal/test/marker/testdata: move test to correct location
+ 2024-01-31 da7ed6494 gopls/internal/cache/imports: simplify importsState invalidation
+ 2024-01-30 7ec8ac08d gopls/internal/golang: hover: show type's methods after doc comment
+ 2024-01-29 0e1f5be92 gopls: update x/telemetry dependency
+ 2024-01-29 341c0434d gopls/internal/test/integration/bench: fix broken benchmarks
+ 2024-01-29 b048cf126 cmd/callgraph: unskip TestCallgraph on windows/arm64
+ 2024-01-29 14d7f7b65 gopls/internal/cache: memoize the view filter func
+ 2024-01-29 5e1643725 gopls/internal/cache: skip TestZeroConfigAlgorithm on wasm
+ 2024-01-29 dd0f88f02 gopls/doc/emacs.md: explain how to organize imports automatically
+ 2024-01-25 3d49bd525 internal/lsp: publish protocol.UnmarshalJSON
+ 2024-01-24 35d8b1b59 gopls/internal/golang: don't bug.Report repaired ASTs in hover
+ 2024-01-24 8174727b3 gopls/internal/test: await quiescence in TestInconsistentVendoring
+ 2024-01-24 df2fa1e99 gopls/doc: s/source/golang/ in the SVG file
+ 2024-01-24 238800b70 gopls: manual tweaks after the lsp/ -> . rename
+ 2024-01-24 95c6ac4a5 gopls/internal/protocol/command: move from ../lsp
+ 2024-01-24 6d109d113 gopls/internal/protocol: move out of lsp/
+ 2024-01-24 f872b3d6f gopls/internal/cache: move out of lsp/
+ 2024-01-24 6823da4bc gopls/internal/golang: move from lsp/source
+ 2024-01-23 129144e6c gopls/internal/lsprpc: move out of lsp/
+ 2024-01-23 eed199759 gopls: use relative watched file patterns if supported
+ 2024-01-23 fa791ac34 gopls/internal/progress: simplify API
+ 2024-01-23 816dcdfba go/packages: add test for flake observed on Android
+ 2024-01-23 d5e76f13c gopls/internal/progress: move from lsp/
+ 2024-01-23 6fe9326ff gopls/internal/telemetry/cmd/stacks: include client name in report
+ 2024-01-23 6a58b9848 gopls/internal/lsp/lsprpc: radically reduce API
+ 2024-01-23 0ffb1d053 gopls/doc: add Helix editor documentation for gopls
+ 2024-01-23 c16e22246 gopls/internal/test/integration: add regtest for hover crash
+ 2024-01-23 bd547e596 gopls/internal/lsp/cache: clean up public API
+ 2024-01-22 4c532679b gopls/internal/lsp/cache: don't report a bug for standalone test files
+ 2024-01-22 a49867fe1 internal/imports: don't add imports that shadow predeclared names
+ 2024-01-22 e2ca5942a gopls/internal/lsp/source: address problems detected by staticcheck
+ 2024-01-22 94d99e340 gopls/internal/test/marker: re-enable some tests
+ 2024-01-22 060c748a2 gopls: consolidate analyzers, eliminating "convenience" analyzers
+ 2024-01-22 7f6ec23c6 go/ssa: suppress go/packages-based test on android
+ 2024-01-22 a987ef7ae go/packages: publish Driver{Request,Response}
+ 2024-01-19 e1555a36d go/ssa: add Function.DomPostorder
+ 2024-01-19 cd7b5109b gopls/internal/lsp/cache: allow versions of form "go1.2.3"
+ 2024-01-19 d0930dbc1 gopls/internal/lsp/cache: fix bug reports from toGobDiagnostics
+ 2024-01-19 1871a2e93 gopls/internal/lsp/source: move Go CodeActions logic from server
+ 2024-01-19 afcd676c5 gopls/internal/lsp/source: show promoted methods in hover
+ 2024-01-19 525acd127 go/analysis/internal/analysisflags: add RelatedInformation JSON
+ 2024-01-19 c7ccb5172 gopls/doc/design: rewrite the architecture overview
+ 2024-01-19 39a254580 gopls/internal/version: amend the year in a recent copyright header
+ 2024-01-19 186fcf30e gopls/internal/lsp/source: factor edit conversion utils
+ 2024-01-19 83c6c25d3 gopls/internal/server: analyze widest packages for open files
+ 2024-01-19 c467be361 gopls: add a main.version variable to override the version at linktime
+ 2024-01-19 6673e7a46 gopls/internal/lsp/source/completion: infer parameter types
+ 2024-01-18 3458e0c56 gopls/internal/lsp/source: fix Fix titles
+ 2024-01-18 72a36a788 gopls/internal/test/marker: fix test breakage due to semantic conflict
+ 2024-01-18 470afdaa8 gopls/internal/analysis/unusedparams: eliminate false positives
+ 2024-01-18 592d9e1e8 internal/lsp: convert refactor code actions to use codeAction/resolve
+ 2024-01-17 f2d3f78aa gopls/internal/lsp/protocol: fix TestURIFromPath on windows
+ 2024-01-17 d2200d1bd gopls/internal/test/marker: update skip comment for addgowork.txt
+ 2024-01-17 c0db45fb1 gopls/internal/server: simplify DiagnoseFiles to avoid a race
+ 2024-01-17 0d1b47829 gopls/internal/test/integration: fix flakiness of TestResolveImportCycle
+ 2024-01-17 d51711299 gopls/internal/lsp/protocol: deliver log messages in order
+ 2024-01-12 9164f2aed gopls/internal/test/marker: skip on solaris-amd64-oraclerel
+ 2024-01-12 dbc9d3e95 internal/analysisinternal: TypeExpr: don't forget Variadic
+ 2024-01-12 54cf5bc0a internal/debug: show new View information in the debug page
+ 2024-01-12 b37fde9dc gopls: simplify gopls command configuration
+ 2024-01-12 6a0605d4e gopls/internal/test/marker: regenerate golden data
+ 2024-01-11 f572b7efa gopls/internal/lsp/source/stub: trim version suffix from module path
+ 2024-01-11 0b1f1d4bc gopls/internal/lsp/cache: (re-)ensure clean shutdown
+ 2024-01-10 706525de5 gopls/internal/lsp/source/completion: support postfix completion (iferr,
+ 2024-01-09 581c0b357 gopls/internal/lsp/source: add receiver name to stubbed methods
+ 2024-01-08 c95fa0ff4 gopls/internal/test: skip marker tests on darwin builders if -short
+ 2024-01-08 25a0e9d3e go.mod: update golang.org/x dependencies
+ 2024-01-05 c9c95f97f internal/refactor/inline: improve a confusing error message
+ 2024-01-05 ba8672b53 go/analysis/passes/unusedresult: add functions from slices package

Change-Id: I428339a4a66ce849c3a3f8827da47125218bb121
tree: 71be6fcfb449bf86560fa6d0e5c0f17bff1da3f5
  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.