github golang/tools gopls/v0.7.3

latest releases: gopls/v0.17.0-pre.2, gopls/v0.17.0-pre.1, v0.27.0...
3 years ago

gopls/v0.7.3

Features

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:

Screen Shot 2021-10-19 at 4 31 31 PM

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:

Screen Shot 2021-10-19 at 4 25 30 PM

Screen Shot 2021-10-19 at 4 25 40 PM

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:

func f[T any](T) {}

func _() {
	f[string]("foo") // string could be inferred
}

Fixes

A full list of all issues fixed can be found in the gopls/v0.7.3 milestone. To report a new problem, please file a new issue at https://golang.org/issues/new.

Thank you to our contributors!

@chitoku-k @danp @rentziass @jhchabran @krobelus @marwan-at-work @leitzler

Don't miss a new tools release

NewReleases is sending notifications on new releases.