Skip to content

Commit

Permalink
Bump golang.org/x/tools from 0.2.0 to 0.18.0 (#158)
Browse files Browse the repository at this point in the history
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.2.0
to 0.18.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/golang/tools/releases">golang.org/x/tools's
releases</a>.</em></p>
<blockquote>
<h2>gopls/v0.15.0-pre.3</h2>
<p><strong>These are release notes for a prerelease version of gopls.
v0.15.0 will be released soon, but please try the prerelease if you
can!</strong></p>
<pre><code>go install golang.org/x/tools/[email protected]
</code></pre>
<p>This release introduces &quot;zero config&quot; gopls, which is a set
of heuristics allowing gopls to Do The Right Thing when you open a Go
file. We believe this addresses the two largest pain points we hear
about from our users: difficulty configuring multi-module repositories,
and working on multiple GOOS/GOARCH combinations. However, this is a
large change to the way gopls models your workspace, and the dynamic
loading/unloading of builds may be surprising in some cases. Your
feedback on this new feature is greatly appreciated. See below for more
details.</p>
<h2>New Features</h2>
<h3>Simpler workspace configuration and improved build tag support</h3>
<p>The headline feature of this release is a rewrite of gopls's logic
for associating files with build configurations that enables gopls to
give accurate answers when navigating almost any Go source file on your
machine.</p>
<p>Most features of gopls rely on type information, which comes not from
the file in isolation but depends on the relationship between the file
and the other files in its package, and between the package and all its
dependencies; this in turn depends on go.mod and go.work files. In
effect, gopls needs to decide which <code>go build</code> command--which
working directory, package arguments, GOOS, GOARCH, build tags, and so
on--would cause each file to be processed by the compiler.</p>
<p>Previous versions of gopls only allowed one build per workspace
folder, and users had to be careful to configure the right workspace
root and build environment. As a result, users often encountered
confusing error messages when they opened the wrong directory, or a file
that was tagged for a different operating system or architecture--the
dreaded &quot;No packages found&quot; error. This situation was improved
by the introduction of <code>go.work</code> files, but still required
configuration and a preexisting understanding of the code being
edited.</p>
<p>With this release, gopls now allows multiple builds per workspace,
and uses heuristics to automatically derive the set of active builds.
Gopls will ensure that an active build contains every module with an
open file in your workspace, adding new builds and GOOS/GOARCH
combinations as needed to cover files that don't match the host
operating system or architecture.</p>
<p>For example, suppose we had a repository with three modules:
<code>moda</code>, <code>modb</code>, and <code>modc</code>, and a
<code>go.work</code> file using modules <code>moda</code> and
<code>modb</code>. If we open the files <code>moda/a.go</code>,
<code>modb/b.go</code>, <code>moda/a_windows.go</code>, and
<code>modc/c.go</code>, gopls will automatically create three
builds:</p>
<p><img
src="https://github.com/golang/tools/assets/57144380/25dc6145-1a20-4fcd-95d7-229721ff480a"
alt="Zero Config" /></p>
<p>In some cases this may cause gopls to do more work, since gopls is
now tracking three builds instead of one. However, the <a
href="https://go.dev/blog/gopls-scalability">scalability redesign</a> we
first announced in <a
href="https://github.com/golang/tools/releases/tag/gopls%2Fv0.12.0">v0.12</a>
allows us to avoid most of this work by efficient caching in a
persistent store.</p>
<p>So, all gopls' navigation, query, analysis, and refactoring features
should work equally well in both files. Notably, you'll see compiler
diagnostics for the appropriate build in real time, making it much
easier to make changes to cross-platform code.</p>
<h3>Preview refactoring edits</h3>
<p>Refactoring code actions now support resolving edits. This update
enables features like <a
href="https://redirect.github.com/microsoft/vscode/issues/151140">code
action previews</a> within VS Code (triggered by Ctrl+Enter).</p>
<p><img
src="https://github.com/golang/tools/assets/6634754/1f05ba21-138a-42c1-9f04-07071f9ca0d6"
alt="Refactor preview in VS Code" /></p>
<p>To take advantage of this new gopls feature, clients must register
support via:</p>
<pre lang="json"><code>{
	&quot;textDocument&quot;: {
		&quot;codeAction&quot;: {
			&quot;dataSupport&quot;: true,
			&quot;resolveSupport&quot;: {
				&quot;properties&quot;: [&quot;edit&quot;]
			}
		}
	}
}
</code></pre>
<h3>Analysis &amp; diagnostics</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/golang/tools/commit/c5643e9baf7fed6936d70e3abf925f86fa895ca1"><code>c5643e9</code></a>
gopls/internal/server: fix two bugs related to dynamic
configuration</li>
<li><a
href="https://github.com/golang/tools/commit/50b4f1b124a3a03ca655a70817a9b95eedab863d"><code>50b4f1b</code></a>
gopls/internal/golang: close open file</li>
<li><a
href="https://github.com/golang/tools/commit/f0ef3c690241cae5119135077dee723e50c1278d"><code>f0ef3c6</code></a>
gopls: update x/telemetry dependency to fix crash</li>
<li><a
href="https://github.com/golang/tools/commit/8cf0a8e204a2438da431f503635abed925cbfb79"><code>8cf0a8e</code></a>
gopls: record that v0.15 will be the last to support go1.18</li>
<li><a
href="https://github.com/golang/tools/commit/730dc3c170c3e54f0dc78e72a0943f7cd43bb425"><code>730dc3c</code></a>
gopls/internal/settings: add a hidden option to disable zero config</li>
<li><a
href="https://github.com/golang/tools/commit/95f04f4ae85908c11fcb0f0cdb7d0e14ca318fe3"><code>95f04f4</code></a>
gopls/internal/golang: add resolve support for inline refactorings</li>
<li><a
href="https://github.com/golang/tools/commit/9619683231abea86b02c3e2af49a1f5ee9fc5d1a"><code>9619683</code></a>
gopls/internal/cache: treat local replaces as workspace modules</li>
<li><a
href="https://github.com/golang/tools/commit/a5af84e3f3e3a6f2652789eeba70253d6ea8cb4c"><code>a5af84e</code></a>
gopls/internal/cache: check views on any on-disk change to go.mod
files</li>
<li><a
href="https://github.com/golang/tools/commit/a7407facde3f3a9b2736a7306823549d2c24efae"><code>a7407fa</code></a>
gopls: update telemetry</li>
<li><a
href="https://github.com/golang/tools/commit/314368ddf001d9629fdf2df9fce2b209f8890925"><code>314368d</code></a>
go/analysis/passes/deepequalerrors: audit for types.Alias safety</li>
<li>Additional commits viewable in <a
href="https://github.com/golang/tools/compare/v0.2.0...v0.18.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/tools&package-manager=go_modules&previous-version=0.2.0&new-version=0.18.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] authored Mar 22, 2024
1 parent 3d33fb1 commit c9ae04c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
9 changes: 3 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ module go.uber.org/mock
go 1.20

require (
golang.org/x/mod v0.11.0
golang.org/x/tools v0.2.0
golang.org/x/mod v0.15.0
golang.org/x/tools v0.18.0
)

require (
github.com/yuin/goldmark v1.4.13 // indirect
golang.org/x/sys v0.1.0 // indirect
)
require github.com/yuin/goldmark v1.4.13 // indirect
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=

0 comments on commit c9ae04c

Please sign in to comment.