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:
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:
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