Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump golang.org/x/tools/gopls from 0.17.1 to 0.18.1 #238

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 24, 2025

Bumps golang.org/x/tools/gopls from 0.17.1 to 0.18.1.

Release notes

Sourced from golang.org/x/tools/gopls's releases.

gopls/v0.18.1

This release:

  • fixes two bugs in the minmax algorithm of the modernize analyzer that caused it to generate incorrect fixes; and
  • restores the experimental hoverKind=structuredgolang/go#71879

gopls/v0.18.0

This release contains some small changes to gopls behavior, bug fixes, and new features.

Notably, the new modernize analyzer reports hint diagnostics suggesting ways that Go code could be updated to take advantage of new Go language features and standard library APIs. If hint level diagnostics are noisy in your editor, and you find these diagnostics disruptive, you can disable these analyses by setting:

"analyses": {
  "modernize": false
}

Configuration Changes

  • The experimental Structured value for the hoverKind option is no longer supported.

  • The gc_details code lens has been deleted. (It was previously disabled by default.) This functionality is now available through the toggleCompilerOptDetails code action, described below, as code actions are better supported than code lenses across a range of clients.

    VS Code's special "Go: Toggle GC details" command continues to work.

  • The experimental semanticTokenTypes and semanticTokenModifiers options allow selectively disabling certain types of tokens or token modifiers in textDocument/semanticTokens responses.

    These options supersede the noSemanticString and noSemanticTokenNumber options, which are now deprecated. Users can instead set "semanticTokenTypes": {"string": false, "number": false} to achieve the same result. For now, gopls still honors noSemanticTokenString and noSemanticToken, but will stop supporting them in a future release.

  • The new workspaceFiles option allows configuring glob patterns matching files that define the logical build of the workspace. This option is only needed in environments that use a custom golang.org/x/tools/go/packages driver.

New features

"{Show,Hide} compiler optimization details" code action

This code action, accessible through the "Source Action" menu in VS Code, toggles a per-directory flag that causes Go compiler optimization details to be reported as diagnostics. For example, it indicates which variables escape to the heap, and which array accesses require bounds checks.

New modernize analyzer

Gopls now reports when code could be simplified or clarified by using more modern features of Go, and provides a quick fix to apply the change.

For example, a conditional assignment using an if/else statement may be replaced by a call to the min or max built-in functions added in Go 1.18.

Use this command to apply modernization fixes en masse:

$ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...

We are aware of a number of minor bugs in the analyzer's fixes. For example, it may sometimes cause a variable or an import to become unused, or may delete comments within a for or if block that is simplified to a library call. The known bugs are low-risk and easy to fix, as they result in a broken build or are obvious during a code review; none cause latent behavior changes. Please report any additional problems you encounter.

... (truncated)

Commits
  • 0b62b3f gopls: update go.mod for v0.18.1-pre.2
  • 5055f70 [gopls-release-branch.0.18] gopls/internal/settings: fix misleading error mes...
  • 216b8f2 [gopls-release-branch.0.18] gopls/internal/golang: add missing json tags for ...
  • f88a3b5 gopls: update go.mod for v0.18.1-pre.1
  • 43a8bd9 [gopls-release-branch.0.18] gopls: temporarily reinstate the "Structured" hov...
  • c075684 [gopls-release-branch.0.18] gopls/internal/analysis/modernize: fix minmax bug
  • e5fe074 [gopls-release-branch.0.18] gopls/internal/analysis/modernize: fix bug in minmax
  • e59d1ba gopls: update go.mod for v0.18.0-pre.6
  • 31e3bb2 [gopls-release-branch.0.18] gopls/internal/analysis/modernize: fix rangeint bug
  • 260fd3c [gopls-release-branch.0.18] gopls/internal/analysis/modernize: disable unsoun...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Feb 24, 2025
@jacobbednarz
Copy link
Owner

@dependabot recreate

@dependabot dependabot bot force-pushed the dependabot/go_modules/golang.org/x/tools/gopls-0.18.1 branch from 252450f to f933847 Compare February 24, 2025 22:18
Bumps [golang.org/x/tools/gopls](https://github.com/golang/tools) from 0.17.1 to 0.18.1.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](golang/tools@gopls/v0.17.1...gopls/v0.18.1)

---
updated-dependencies:
- dependency-name: golang.org/x/tools/gopls
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/go_modules/golang.org/x/tools/gopls-0.18.1 branch from f933847 to 50f5fe1 Compare February 24, 2025 22:19
@jacobbednarz jacobbednarz merged commit cf386d7 into master Feb 24, 2025
1 check passed
@jacobbednarz jacobbednarz deleted the dependabot/go_modules/golang.org/x/tools/gopls-0.18.1 branch February 24, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant