Commit graph

53 commits

Author SHA1 Message Date
wiz
de1ad7e0c6 gopls: update to 0.8.3.
New Features

Gopls now integrates with staticcheck@v0.3.0, which supports
generics. To enable staticcheck analyzers, set "staticcheck": true
in your gopls settings. Note that as part of this change, staticcheck
is only supported when gopls is built with Go 1.17+.
2022-04-20 20:54:45 +00:00
bsiegert
865174470d Revbump all Go packages after go117 update 2022-04-13 07:50:51 +00:00
bsiegert
ba375506be gopls: update to 0.8.2
New Features

Fuzz target inference: Gopls will now infer the type of Fuzz targets from
preceding testing.F.Add statements.

Generic completion improvements: This release includes several improvements to
auto-completion of generic code. For example, completion of type or function
instantiation now prefers types that are in terms of the constraint type set.

Bugfixes

The timing of this release is primarily driven by golang/vscode-go#2121, a
panic when go.work files are missing a go directive. We received enough reports
of this crash to know that it was affecting a significant number of users.
Thanks to all those who reported issues - your diligence helps us make gopls
better!
2022-04-09 18:49:49 +00:00
wiz
25324428bb gopls: update to 0.8.1.
This is a small release to pick up some bugfixes/improvements for Go 1.18 support.
2022-03-30 08:23:21 +00:00
wiz
f394fd1c23 gopls: update to 0.8.0.
Go version support

Support for Go 1.18

Version 0.8.0 of gopls supports features added to Go 1.18,
specifically:

    Support for multi-module workspaces using go.work files.
    Diagnostics for Fuzz tests.  Improved support for generics.

To use these features, gopls must be installed using Go 1.18. See
go.dev/dl for the latest status of Go 1.18 -- as of writing Go 1.18
is not yet released, but Go 1.18 RC1 may be used.

Dropped support for Go 1.12

Version 0.8.0 of gopls no longer supports building at Go 1.12. See
golang/go#50827 for more details.

New Features

go.work integration

Gopls now supports multi-module workspaces using go.work files. To
use this feature, create a go.work file that includes the modules
you want to work on, and then open your editor to the directory
containing go.work. For more information, see the go.work reference,
or the gopls documentation for multi-module workspaces.

Diagnostics for Fuzz tests

When writing Fuzz tests, gopls provides diagnostics for invalid
arguments to Fuzz.

Improved support for generics

Honor the language version configured in go.mod

gopls now provides diagnostics for language features based on the
go directive in the applicable go.mod file for a package.

For some errors related to incompatible language versions, gopls
offers a quick-fix to update the go.mod Go version. (note that if
the go.mod file is open, it may need to be saved in order for
language version changes to take effect)

gomodedit

Improved completion with type parameters

Gopls autocompletion is improved in several contexts when using
generic types.

genericvarcompl

New code action to add missing method stubs

Gopls now provides a code action to implement missing methods.

Improved performance and accuracy for workspace symbol requests

Workspace symbols uses a new fuzzy matcher that is up to 3x faster
than previous, and has improved ranking. See golang/go#50016 for
more details. Note that the first time workspace symbols are
requested, there may be a delay as the symbol cache is populated.

Improved gofumpt integration

Gopls now sets the language version and module path when invoking
gofumpt, allowing more accurate formatting based on context.
2022-03-08 08:33:03 +00:00
bsiegert
e2ad32e62b Revbump all Go packages after go117 update 2022-03-07 09:14:02 +00:00
bsiegert
ebe4158c52 Revump all Go packages after go117 update 2022-02-13 19:24:21 +00:00
wiz
79eac9f266 gopls: update to 0.7.5.
Configuration changes

templateExtensions now defaults to []

Following feedback on the template features introduced with v0.7.4,
we have made improvements to the way the active set of template
files is configured. The templateExtensions setting is now empty
by default, and gopls recognizes any open files with the "gotmpl"
language identifier as a template file. As a result, unopened files
will not be loaded as Go templates unless the templateExtensions
is configured to be non-empty, but gopls will still provide template
language features to any open files configured to be Go template
files by the LSP client.

As always, your feedback helps make gopls better, and is greatly
appreciated!

Features

New postfix completions

    The split! completion on values of string type inserts a
    strings.Split snippet.  split

    The join! completion on values of []string type inserts a
    strings.Join snippet.  join

New suggested fix for unused function parameters

The diagnostic for unused function parameters now includes a
suggested fix to rename the parameter to _. This diagnostic is
disabled by default, but can be enabled via the unusedparams setting
in the analyses section.
2022-01-23 22:10:27 +00:00
bsiegert
69b9f4cba9 Revbump all Go packages after go117 update 2022-01-09 20:10:29 +00:00
wiz
e99c205cd6 gopls: update to 0.7.4.
Features

Editing support for Go template files

Gopls support for template files is now generally available. While
editing files intended for use with the text/template or html/template
packages, gopls can provide completion, syntax highlighting,
jump-to-definition, find references, and diagnostics.

To use this feature, your editor or LSP client must be configured
to activate gopls for Go template files. By default, gopls considers
files ending with .tmpl or .gotmpl to be template files, though
this is configurable via the templateExtensions setting. More
information in the documentation.

Improved support for generic code when using the Go 1.18 beta

This release includes several bug fixes related to editing generic
code, as well as many improvements to diagnostic precision when
operating on type parameters. See the documentation for instructions
on how to build gopls using a version of Go that supports generic
code.
2022-01-05 21:47:57 +00:00
bsiegert
169637478c Revbump all Go packages after go117 update 2021-12-09 17:50:09 +00:00
bsiegert
41533c256a Revbump all Go packages after go117 update 2021-11-05 20:02:39 +00:00
wiz
db1f8713cf gopls: update to 0.7.3.
Exclude node_modules from the workspace by default

The directoryFilters setting now defaults to [-node_modules], since
these directories never include Go code. This only applies to
node_modules directories at the top level of the workspace, not
arbitrary depths.

Detailed hover for runes

You will now see more information about the rune when you hover
over it. For example:

Undeclared name suggested fix for functions

The undeclaredname analyzer now offers a suggested fix for undeclared
function. Depending on the surrounding code, the suggested fix will
either insert a new variable declaration (as before), or a new
function declaration with inferred parameters and a body that
panics. For example:

New analyzers for generic code (only with Go 1.18)

useany: Check for constraints that could be simplified to "any"

infertypeargs: Check for unnecessary type arguments in call
expressions

Explicit type arguments may be omitted from call expressions if
they can be inferred from function arguments, or from other type
arguments
2021-11-01 09:54:58 +00:00
nia
f27e22519a archivers: Replace RMD160 checksums with BLAKE2s checksums
All checksums have been double-checked against existing RMD160 and
SHA512 hashes

Could not be committed due to merge conflict:
devel/py-traitlets/distinfo

The following distfiles were unfetchable (note: some may be only fetched
conditionally):

./devel/pvs/distinfo pvs-3.2-solaris.tgz
./devel/eclipse/distinfo eclipse-sourceBuild-srcIncluded-3.0.1.zip
2021-10-26 10:13:59 +00:00
tnn
529b2aa5ad remove redundant do-install, CHECK_RELRO_SKIP, INSTALLATIONS_DIRS ...
... for packages where the go-module.mk defaults DTRT as-is.
2021-10-09 10:41:07 +00:00
bsiegert
a235babfa8 Revbump all Go packages after go117 update 2021-10-08 18:55:02 +00:00
nia
2da474aec0 devel: Remove SHA1 hashes for distfiles 2021-10-07 13:38:55 +00:00
bsiegert
a7061b5550 Revbump all Go packages after go117 update 2021-09-17 13:52:45 +00:00
wiz
fcd764aa7b gopls: update to 0.7.2.
Bugfix release, see
https://github.com/golang/go/milestone/221?closed=1
for details.
2021-09-12 09:10:42 +00:00
bsiegert
624af70d8a Revbump all Go packages after go116 update 2021-08-11 19:35:03 +00:00
wiz
44df5ab3b7 gopls: update to 0.7.1.
Features

Experimental

Support go.work files (proposal)

In order to better support the new proposal for a multi-module
workspace mode (golang/go#45713), gopls has added support for
go.work files. Try adding a go.work file to the root of your module
(you still need to enable experimentalWorkspaceModule mode) and
try out the proposal!

Use invalid metadata

Set experimentalUseInvalidMetadata to true in your settings, and
gopls will reuse outdated metadata until new package metadata has
been successfully reloaded. This is useful if your go.mod file is
temporarily invalid. In a future release, this setting will be
moved out of experimental and deleted.
2021-08-10 19:28:33 +00:00
bsiegert
267ed82d11 Revbump all Go packages after go116 update 2021-07-13 11:36:30 +00:00
wiz
678f6b497f gopls: update to 0.7.0.
Features

Postfix completions

Postfix completions are a new style of completions that can save
you time by inserting more complex pieces of commonly-written code.
All of the results end with !. This feature was added experimentally
in gopls/v0.6.10 and is now enabled by default.

New commands: List known packages and add import

These commands can be used to manually list available packages to
import and then add an import to your file. They are currently not
used by any known clients, but they will be made available through
the Command Palette in VS Code in the next VS Code Go release.

Improvements

Memory usage

Improved trimming of the ASTs of dependency packages results in
reduced memory usage, especially for projects with many dependencies.
This may result in some hard-to-diagnose bugs that we're not yet
aware of, so please report any surprising behavior via
https://golang.org/issues/new.
2021-06-28 07:38:06 +00:00
bsiegert
de0d02561a Revbump all Go packages after go116 update 2021-06-06 12:18:40 +00:00
wiz
880c919c09 gopls: update to 0.6.11.
This release contains mainly bug fixes.
2021-05-20 10:03:16 +00:00
bsiegert
2af0bedf36 Revbump all Go packages after go116 update 2021-05-08 15:02:22 +00:00
wiz
21ca77f86e gopls: update to 0.6.10.
Features

t.Fatal snippet

If you trigger completion in a test function, on the line after a
call to a function that returns an error, you will be offered a
completion snippet for:

if err != nil {
    t.Fatal(err) }

Experimental

Postfix completion snippets

Postfix completions are a new style of completions that can save
you time by inserting more complex pieces of commonly-written code.
All of the results end with !. Enable this feature by setting
"ui.completion.experimentalPostfixCompletions": true.
2021-04-25 21:28:40 +00:00
wiz
ad80824f43 gopls: update to 0.6.9.
0.6.9
This is a patch release to fix golang/go#45092.

0.6.8
This is a patch release to fix golang/go#45075.

0.6.7
New analyzers

The unusedwrite and nilness analyzers are now available, but they
are disabled by default. Note that enabling them permanently may
significantly increase memory usage. You can configure analyzers
through the analyses setting.  Improved hover with time.Duration

Hover for any constant of type time.Duration is shown both in
nanoseconds and as a human-readable string.

Fixes

A full list of all issues fixed can be found in the gopls/v0.6.7
milestone. To report a new problem, please file a new issue at
https://golang.org/issues/new.
2021-04-01 18:45:33 +00:00
bsiegert
f6095694fd Revbump all Go packages after go115 update 2021-03-19 17:36:46 +00:00
wiz
7490a5d3f8 gopls: update to 0.6.6.
This release mostly included bug fixes and changes that are not user facing.
2021-03-12 10:33:06 +00:00
wiz
09f44d79dc gopls: update to 0.6.5.
Show available upgrades for dependencies

gopls/v0.6.0 removed support for the code lenses that showed
available upgrades for dependencies. This behavior has now been
reintroduced, with an improved UI. Users must explicitly request
this information by clicking the "Check for upgrades" code lens
above the go.mod file's require block. Any module with available
upgrades will be highlighted with an informational diagnostic and
accepting its suggested fix will preform the upgrade.
2021-02-18 09:57:14 +00:00
wiz
7ad1da690d gopls: update to 0.6.4.
gopls/v0.6.4

Includes fixes for https://blog.golang.org/path-security.

gopls/v0.6.3

This release has a number of bug fixes and documentation improvements.
2021-01-25 09:46:22 +00:00
bsiegert
9956fb746f Revbump all Go packages after go115 update 2021-01-23 14:22:52 +00:00
wiz
eb515c667d gopls: update to 0.6.2.
Features

Shadow analyzer

This off-by-default analyzer flags shadowed variables. Learn more
in the Analyzers documentation.

Experimental

New keys for the GC details "annotations" setting

The previous keys were prefixed with "no" and meant to disable
certain GC details checks, which was inconsistent with the style
of our other settings maps. A warning will appear suggesting a
change to the new key name, but the old settings will continue to
work. Full details can be found in the annotations documentation.

Documentation

Improved documentation for available analyzers.

Improved documentation for Vim.

Fixes

Editing the go.mod file by hand (golang/go#42529)

This issue was previously marked as resolved, but it had not actually
been fixed. Package metadata will now only be invalidated when a
go.mod file is saved, so you will need to save before expecting
your changes to be propagated. This should significantly reduce
the number of go list calls (and therefore CPU utilization) as you
edit the go.mod file.
2021-01-11 22:46:19 +00:00
bsiegert
d802ca168c gopls: update to 0.6.1.
0.6.1

This is a patch release to fix golang/go#43234. The titles of some
suggested fixes were blank, leading to a bad user experience.

0.6.0

Features
- Default to -mod=readonly
- Default to GOPROXY=off
- Inclusion/exclusion filters for directories
- Debouncing for diagnostics
- "Upgrade direct dependencies" code lens
- Support for filling a partially-populated struct
- Experimental: Field alignment analyzer

Fixes
- Improvements to diagnostics tracking
- File watching for directories

Other
- "codelens" setting name changed to "codelenses"
- Disabled support for symlinks
2020-12-20 20:04:09 +00:00
wiz
a21fc005cb gopls: update to 0.5.5.
0.5.5

This is a patch release to fix two bugs in gopls/v0.5.4.

Fixes

Excessive reloading of packages outside of GOPATH or a module

File corruption with CRLF line endings and //-style comments

golang/go#42646 was supposed to have been fixed in gopls/v0.5.4,
but it was not. golang/go#42923 was reported and fixed.

0.5.4

Features

Opening a project that contains a module in a subdirectory

Previously, gopls required that you open your editor exactly at or
below the module root (the directory containing the go.mod). Now,
you can open a directory that contains exactly one module in a
subdirectory, and gopls will work as expected. For details on
multi-module workspaces, see below.

Removal of the granular go.mod upgrade codelenses

Previously, we offered a code lens to suggest upgrades for each
require in a go.mod file. In anticipation of changes that limit
the amount that gopls accesses the network, we have decided to
remove and reevaluate this feature. Users had mentioned that the
code lenses cluttered their go.mod files, especially if they didn't
actually want to upgrade. golang/go#38339 tracks the work to revamp
this feature. An "Upgrade all dependencies" code lens should still
appear at the top of your go.mod file.

Improved error message reports

Previously, critical error messages were reported as message pop-up
that would re-trigger as you type. Many users would find this
annoying. We have changed the approach to show error messages as
progress reports, which should be less intrusive and appear more
like status bars.

Improved memory usage for workspaces with multiple folders

We are now using a coarser cache key for package type information.
If you use the gopls daemon, this may reduce your total memory
usage.

Experimental

Multi-module workspace support

The proposal described in golang/go#32394 is still in development
and off by default. See our progress by tracking the multi-module
workspace milestone and project.

Enable multi-module workspace support by adding the following to
your settings:

"gopls": { "experimentalWorkspaceModule": true, }

With this setting, you will be able to open a directory that contains
multiple modules or a directory that contains nested modules.

Give this a try if you're interested in this new feature, but please
note that it is still very experimental. Please file issues if you
encounter bugs.

Fixes

File corruption with CRLF line endings and /**/-style comments

Previously, when you organized the imports in a file with CRLF line
endings and multi-line comments, the formatter might output incorrect
content for the file, rendering it invalid Go code. This issue has
popped up a number of times, but we believe it has finally been
fixed for good. If you are using Windows with CRLF line ending,
please report any regressions. For full details, see golang/go#42646.
2020-12-06 10:58:23 +00:00
wiz
e82a906fc5 gopls: update to 0.5.3.
Features

Automatic updates to go.sum

Previously, go.mod-related quick fixes would not make corresponding
changes to your go.sum file. Now, when you add or remove dependencies
from your module, your go.sum will be updated accordingly.

Removed support for go mod tidy on save

We have removed the support for running go mod tidy on save for
go.mod files. It proved to be too slow and expensive to be worth
it.

Experimental

Multi-module workspace support

The proposal described in golang/go#32394 is still in development
and off by default. See our progress by tracking the multi-module
workspace milestone and project.

Enable multi-module workspace support by adding the following to
your settings:

"gopls": { "experimentalWorkspaceModule": true, }

With this setting, you will be able to open a directory that contains
multiple modules. Most features will work across modules, but some,
such as goimports, will not work as expected.

Give this a try if you're interested in this new feature, but please
note that it is still very experimental.

Fixes

A list of all issues fixed can be found in the gopls/v0.5.3 milestone.
2020-11-23 14:52:14 +00:00
bsiegert
2915abcd8b Revbump all Go packages after go115 update 2020-11-13 19:26:03 +00:00
wiz
94eb43aaea gopls: update to 0.5.2.
Features

No new features have been added in this release.

Experimental

We have added support for a new allExperiments setting. By enabling
this flag, you will enable all experimental features that we intend
to roll out slowly. You can still disable individual settings (full
list of settings). In-progress features, such as multi-module
workspaces (below), will remain disabled until they are ready for
users.

Improved CPU utilization: experimentalDiagnosticsDelay

experimentalDiagnosticsDelay controls the amount of time that gopls
waits after the most recent file modification before computing deep
diagnostics. Simple diagnostics (parsing and type-checking) are
always run immediately on recently modified packages.

Enable it by setting it to a duration string, for example "200ms".
With allExperiments, this is set to "200ms".

Improved memory usage for workspaces with multiple folders:
experimentalPackageCacheKey

experimentalPackageCacheKey controls whether to use a coarser cache
key for package type information. If you use the gopls daemon, this
may reduce your total memory usage.

Enable it by setting it to true. With allExperiments, this is set
to true.

Multi-module workspace support

The proposal described in golang/go#32394 is still in development
and off by default. See our progress by tracking the multi-module
workspace milestone and project.

Enable multi-module workspace support by adding the following to
your settings:

"gopls": { "experimentalWorkspaceModule": true, }

With this setting, you will be able to open a directory that contains
multiple modules. Most features will work across modules, but some,
such as goimports, will not work as expected.

Give this a try if you're interested in this new feature, but please
note that it is still very experimental.

Support for semantic tokens

This is a new, unreleased LSP feature that provides additional
syntax highlighting. In advance of this new LSP version, we have
added preliminary support for this feature. Enable it by setting:

"gopls": { "semanticTokens": true, }

It will not be enabled with allExperiments.

Fixes

A list of all issues fixed can be found in the gopls/v0.5.2 milestone.

For editor clients

All command names have been given gopls. prefixes, to avoid
conflicting with commands registered by other language servers.
This should not have affected any clients.
2020-11-09 14:25:31 +00:00
bsiegert
bea1f7d75a Revbump all Go packages after Go 1.15 update. 2020-11-08 21:59:09 +00:00
wiz
4002f9c404 gopls: Add RCS Id. 2020-10-14 16:29:26 +00:00
wiz
3ef362cf2f gopls: update to 0.5.1.
Features

Completion speed improvements

https://golang.org/cl/257240 eliminated some duplicate type-checking in completions (and some other features), halving latency in most cases.
Improvements to symbol rankings

From https://golang.org/cl/254037:

    Downrank symbols if they are:

        Unexported and outside of the workspace. Since one wouldn't jump to these symbols to e.g. view documentation, they are less relevant.
        Fields and interface methods. Usually one would jump to the type name, so having fields highly ranked can be noisy.

Warnings for excluded files

You will now see diagnostics if you open a file that is excluded from the current build, likely by build tags. This should aid in understanding cases when gopls fails to work on a certain file.
Better error reporting when code lenses fail

A pop-up with an error will appear if a code lens fails to run its command.
Experimental
Multi-module workspace support

The proposal described in golang/go#32394 is partially implemented, but off by default.
Enable multi-module workspace support by adding the following to your settings:

"gopls": {
    "experimentalWorkspaceModule": true,
}

With this setting, you will be able to open a directory that contains multiple modules. Most features will work across modules, but some, such as go mod tidy diagnostics, are not yet implemented.

Give this a try if you're interested in this new feature, but please note that it is still very experimental.
Fixes
Toggle GC Details on Windows

There was a bug in the new experimental GC details code lens on Windows machines (golang/go#41614). We added a work-around to fix the issue.

A list of all issues fixed can be found in the gopls/v0.5.1 milestone.
Documentation

The documentation for settings is now automatically generated so it will stay up-to-date. Documentation was also updated for working with Neovim and for working on the Go project itself.
Thank you to our contributors!

@heschik @findleyr @dandua98 @pjweinb @ainar-g
2020-10-14 16:23:33 +00:00
bsiegert
3d8033bcbc gopls: update to 0.5.0.
Memory usage

- Rewrite of caching model, resulting in significant memory usage improvements
  (@heschik).

New features

- Extract to function: Support for extracting code blocks that contain return
  statements (@joshbaum).
- Workspace symbols: Support for fzf-style search syntax (@findleyr). The
  following syntax is supported:
        ' for exact matching
        ^ for prefix matching
        $ for suffix matching

Note: This feature does not yet work in VS Code. See golang/vscode-go#647 and
microsoft/vscode#106788.

- An experimental new code lens to view GC optimization details (@pjweinb).
  Once the code lens is enabled, you will see a Toggle gc details annotation at
  the top of your file. Clicking it will show optimization diagnostics produced
  by the Go compiler, and clicking it once again will hide these diagnostics.
  Enable the code lens by adding the following to your settings:

     "codelens": {
     	"gc_details": true
     }

- go mod tidy and go mod vendor code lenses for go.mod files (@dandua98).
- Support for filling in matching in-scope variables instead of just empty
  values in fillstruct and fillreturns (@joshbaum).
- Autocompletion within import statements (@dandua98).
- Autocompletion within package declarations (@dandua98).

Improvements

- Improvements to workspace symbols ranking and fuzzy matching (@findleyr,
  @myitcv).
- Better completion suggestions in type switch case clauses and for calls to
  append, function literals, and unnamed types (@muirdm).
2020-09-17 14:59:35 +00:00
bsiegert
43f54ecac5 Revbump all Go packages after default Go version was changed to 1.15.1 2020-09-03 07:29:32 +00:00
wiz
97f41c117c gopls: update to 0.4.4.
* Support for opening a single file. Previously, gopls required
  you to open an entire directory.
* Support features and diagnostics for the entire module, even when
  you open a subdirectory of the module.
* Extract a selected range to a variable or to a function. This
  feature is still relatively new, so please report issues if you
  encounter any. (@joshbaum)
* Fillstruct performance improvements. It is now enabled by default
  again. (@joshbaum)
* Improvements in go.mod diagnostic error presentation.
2020-08-24 07:56:49 +00:00
bsiegert
9fad3613b8 Revbump all Go packages after go114 update 2020-08-14 20:01:19 +00:00
wiz
468a1a4c72 gopls: update to 0.4.3.
0.4.3

Disable the fillstruct analysis by default.
We recently uncovered some performance issues with the analysis, leading us to disable it by default.
Once those issues are resolved, we will enable it by default again.
You can still enable it by adding the following to your VS Code settings:

"gopls": {
	"analyses": {
		"fillstruct": true,
	}
}


gopls/v0.4.2

    Significant memory improvements (@heschik). Dependency test variants and vendored packages are no longer considered "workspace packages".
    Smart autocompletion for "append" (@muirdm).
    A "fill struct" code action to suggest populating a struct literal with default values (@luciolas, @joshbaum).
    Better cgo support with Go 1.15 (@heschik). Learn more: golang/go#35721 (comment).
    Code lens to run Go tests directly in the editor (@martskins). Currently opt-in:

"gopls": {
    "codelens": {
        "test": true,
    }
}

    Improved folding in composite literals (@joshbaum).
    Pop-up suggestion to run go mod vendor when inconsistent vendoring detected (@stamblerre).
    Respect GOPRIVATE for all document links and links on hover (@findleyr).
    A full list of issues resolved in this release can be found in the gopls/v0.4.2 milestone.

gopls/dev.go2go: You can use the new go2go prototype with gopls. See golang/go#39619.
2020-07-31 09:12:58 +00:00
bsiegert
20b9b74c5f Revbump all Go packages after go114 update. 2020-07-17 18:04:11 +00:00
bsiegert
121a05e61b Revbump Go packages after Go 1.14.4 update. 2020-06-17 09:54:00 +00:00
wiz
22266d2a1f gopls: add link to release notes in comment 2020-06-10 18:02:37 +00:00