Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gopls for openSUSE:Factory checked in at 2023-10-30 22:11:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gopls (Old) and /work/SRC/openSUSE:Factory/.gopls.new.17445 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "gopls" Mon Oct 30 22:11:42 2023 rev:7 rq:1121256 version:0.14.1 Changes: -------- --- /work/SRC/openSUSE:Factory/gopls/gopls.changes 2023-10-26 17:14:26.812330321 +0200 +++ /work/SRC/openSUSE:Factory/.gopls.new.17445/gopls.changes 2023-10-30 22:12:09.207244937 +0100 @@ -1,0 +2,8 @@ +Mon Oct 30 16:56:27 UTC 2023 - Jeff Kowalczyk <jkowalczyk@suse.com> + +- Update to version 0.14.1: + * gopls: update go.mod for v0.14.1-pre.1 + * gopls/internal/lsp: fix code action panic on params of external funcs + * go/packages: don't fail if GOPACKAGESDRIVER leaves Compiler/GOARCH="" + +------------------------------------------------------------------- Old: ---- gopls-0.14.0.tar.gz New: ---- gopls-0.14.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gopls.spec ++++++ --- /var/tmp/diff_new_pack.HC3dA9/_old 2023-10-30 22:12:09.735264417 +0100 +++ /var/tmp/diff_new_pack.HC3dA9/_new 2023-10-30 22:12:09.739264564 +0100 @@ -17,7 +17,7 @@ Name: gopls -Version: 0.14.0 +Version: 0.14.1 Release: 0 Summary: Go LSP protocol language server License: Apache-2.0 AND MIT AND BSD-3-Clause ++++++ _service ++++++ --- /var/tmp/diff_new_pack.HC3dA9/_old 2023-10-30 22:12:09.767265598 +0100 +++ /var/tmp/diff_new_pack.HC3dA9/_new 2023-10-30 22:12:09.767265598 +0100 @@ -4,7 +4,7 @@ <param name="scm">git</param> <param name="include">gopls</param> <param name="include">LICENSE</param> - <param name="revision">gopls/v0.14.0</param> + <param name="revision">gopls/v0.14.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">gopls/v(.*)</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.HC3dA9/_old 2023-10-30 22:12:09.787266335 +0100 +++ /var/tmp/diff_new_pack.HC3dA9/_new 2023-10-30 22:12:09.791266483 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/golang/tools.git</param> - <param name="changesrevision">c405dc884429f40a2e0c02829def6d2e3dfed5d1</param></service></servicedata> + <param name="changesrevision">e985f842fa05caad2f3486f0711512aedffbcda8</param></service></servicedata> (No newline at EOF) ++++++ gopls-0.14.0.tar.gz -> gopls-0.14.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gopls-0.14.0/gopls/go.mod new/gopls-0.14.1/gopls/go.mod --- old/gopls-0.14.0/gopls/go.mod 2023-10-24 16:50:44.000000000 +0200 +++ new/gopls-0.14.1/gopls/go.mod 2023-10-26 21:38:29.000000000 +0200 @@ -12,7 +12,7 @@ golang.org/x/sys v0.13.0 golang.org/x/telemetry v0.0.0-20231011160506-788d5629a052 golang.org/x/text v0.13.0 - golang.org/x/tools v0.14.1-0.20231024142323-35a647a9c3fc + golang.org/x/tools v0.14.1-0.20231026192422-8b5abd452b28 golang.org/x/vuln v1.0.1 gopkg.in/yaml.v3 v3.0.1 honnef.co/go/tools v0.4.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gopls-0.14.0/gopls/go.sum new/gopls-0.14.1/gopls/go.sum --- old/gopls-0.14.0/gopls/go.sum 2023-10-24 16:50:44.000000000 +0200 +++ new/gopls-0.14.1/gopls/go.sum 2023-10-26 21:38:29.000000000 +0200 @@ -43,8 +43,8 @@ golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.14.1-0.20231024142323-35a647a9c3fc h1:885/39rn2IDn/hUUfUzxMWAowSMB/K+bc3kaOJfc5bo= -golang.org/x/tools v0.14.1-0.20231024142323-35a647a9c3fc/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.14.1-0.20231026192422-8b5abd452b28 h1:5YgdZAe2w0x3Xrjv0+GXrI0jvm7qCQK/ySGFfiEHMfU= +golang.org/x/tools v0.14.1-0.20231026192422-8b5abd452b28/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/vuln v1.0.1 h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU= golang.org/x/vuln v1.0.1/go.mod h1:bb2hMwln/tqxg32BNY4CcxHWtHXuYa3SbIBmtsyjxtM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gopls-0.14.0/gopls/internal/lsp/code_action.go new/gopls-0.14.1/gopls/internal/lsp/code_action.go --- old/gopls-0.14.0/gopls/internal/lsp/code_action.go 2023-10-24 16:50:44.000000000 +0200 +++ new/gopls-0.14.1/gopls/internal/lsp/code_action.go 2023-10-26 21:38:29.000000000 +0200 @@ -541,6 +541,10 @@ return false } + if info.Decl.Body == nil { + return false // external function + } + if len(info.Field.Names) == 0 { return true // no names => field is unused } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gopls-0.14.0/gopls/internal/regtest/misc/fix_test.go new/gopls-0.14.1/gopls/internal/regtest/misc/fix_test.go --- old/gopls-0.14.0/gopls/internal/regtest/misc/fix_test.go 2023-10-24 16:50:44.000000000 +0200 +++ new/gopls-0.14.1/gopls/internal/regtest/misc/fix_test.go 2023-10-26 21:38:29.000000000 +0200 @@ -101,3 +101,36 @@ env.AfterChange(NoDiagnostics(ForFile("main.go"))) }) } + +func TestUnusedParameter_Issue63755(t *testing.T) { + // This test verifies the fix for #63755, where codeActions panicked on parameters + // of functions with no function body. + + // We should not detect parameters as unused for external functions. + + const files = ` +-- go.mod -- +module unused.mod + +go 1.18 + +-- external.go -- +package external + +func External(z int) //@codeaction("refactor.rewrite", "z", "z", recursive) + +func _() { + External(1) +} + ` + Run(t, files, func(t *testing.T, env *Env) { + env.OpenFile("external.go") + actions, err := env.Editor.CodeAction(env.Ctx, env.RegexpSearch("external.go", "z"), nil) + if err != nil { + t.Fatal(err) + } + if len(actions) > 0 { + t.Errorf("CodeAction(): got %d code actions, want 0", len(actions)) + } + }) +} ++++++ vendor.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/tools/go/packages/packages.go new/vendor/golang.org/x/tools/go/packages/packages.go --- old/vendor/golang.org/x/tools/go/packages/packages.go 2023-10-25 17:03:56.000000000 +0200 +++ new/vendor/golang.org/x/tools/go/packages/packages.go 2023-10-30 17:56:29.000000000 +0100 @@ -259,17 +259,28 @@ // provided for convenient display of all errors. func Load(cfg *Config, patterns ...string) ([]*Package, error) { ld := newLoader(cfg) - response, err := defaultDriver(&ld.Config, patterns...) + response, external, err := defaultDriver(&ld.Config, patterns...) if err != nil { return nil, err } - // If type size information is needed but unavailable. - // reject the whole Load since the error is the same for every package. ld.sizes = types.SizesFor(response.Compiler, response.Arch) if ld.sizes == nil && ld.Config.Mode&(NeedTypes|NeedTypesSizes|NeedTypesInfo) != 0 { - return nil, fmt.Errorf("can't determine type sizes for compiler %q on GOARCH %q", - response.Compiler, response.Arch) + // Type size information is needed but unavailable. + if external { + // An external driver may fail to populate the Compiler/GOARCH fields, + // especially since they are relatively new (see #63700). + // Provide a sensible fallback in this case. + ld.sizes = types.SizesFor("gc", runtime.GOARCH) + if ld.sizes == nil { // gccgo-only arch + ld.sizes = types.SizesFor("gc", "amd64") + } + } else { + // Go list should never fail to deliver accurate size information. + // Reject the whole Load since the error is the same for every package. + return nil, fmt.Errorf("can't determine type sizes for compiler %q on GOARCH %q", + response.Compiler, response.Arch) + } } return ld.refine(response) @@ -279,18 +290,20 @@ // It will try to request to an external driver, if one exists. If there's // no external driver, or the driver returns a response with NotHandled set, // defaultDriver will fall back to the go list driver. -func defaultDriver(cfg *Config, patterns ...string) (*driverResponse, error) { - driver := findExternalDriver(cfg) - if driver == nil { - driver = goListDriver +// The boolean result indicates that an external driver handled the request. +func defaultDriver(cfg *Config, patterns ...string) (*driverResponse, bool, error) { + if driver := findExternalDriver(cfg); driver != nil { + response, err := driver(cfg, patterns...) + if err != nil { + return nil, false, err + } else if !response.NotHandled { + return response, true, nil + } + // (fall through) } - response, err := driver(cfg, patterns...) - if err != nil { - return response, err - } else if response.NotHandled { - return goListDriver(cfg, patterns...) - } - return response, nil + + response, err := goListDriver(cfg, patterns...) + return response, false, err } // A Package describes a loaded Go package. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/modules.txt new/vendor/modules.txt --- old/vendor/modules.txt 2023-10-25 17:03:56.000000000 +0200 +++ new/vendor/modules.txt 2023-10-30 17:56:29.000000000 +0100 @@ -59,7 +59,7 @@ ## explicit; go 1.17 golang.org/x/text/unicode/rangetable golang.org/x/text/unicode/runenames -# golang.org/x/tools v0.14.1-0.20231024142323-35a647a9c3fc +# golang.org/x/tools v0.14.1-0.20231026192422-8b5abd452b28 ## explicit; go 1.18 golang.org/x/tools/cover golang.org/x/tools/go/analysis