go icon indicating copy to clipboard operation
go copied to clipboard

cmd/gopls: avoid Command 'gopls.generate' failed: Error: All files must be saved first

Open andig opened this issue 10 months ago • 5 comments

What version of Go are you using (go version)?

$ go version
go version go1.22.2 darwin/arm64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/andig/Library/Caches/go-build'
GOENV='/Users/andig/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/andig/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/andig/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.2/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/andig/htdocs/evcc/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build1839283339=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOROOT/bin/go version: go version go1.22.2 darwin/arm64
GOROOT/bin/go tool compile -V: compile version go1.22.2
uname -v: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103
ProductName:		macOS
ProductVersion:		14.4.1
BuildVersion:		23E224
lldb --version: lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)

What did you do?

Use VScode, switch between branches. Some files remain open that may not exist on the new branch. VScode shows these as missing (red icon).

What did you expect to see?

go generate runs. gopls should be able to differentiate between unsaved and missing files.

What did you see instead?

Running gopls.generate creates an error since it thinkgs the workspace is dirty- which it isn't in this case.

andig avatar Apr 22 '24 06:04 andig

⚠️ No Changeset found

Latest commit: 9c516782f6518f6b32848f567f782b38317ab25a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Apr 27 '24 22:04 changeset-bot[bot]

Is there anything we can do to re-run failed workflows? Thanks!

mellster2012 avatar May 04 '24 21:05 mellster2012

Is there anything we can do to re-run failed workflows? Thanks!

Unfortunately no; there’s just a requirement that new contributors need to have manually-run workflows until they’ve gotten a PR merged. I think it’s just GitHub saving $ (which is fine by me, because of how generously they provide so many resources for OSS).

drwpow avatar May 16 '24 16:05 drwpow

See comment on #1631. I think we need a little more discussion / clarification on what this PR is accomplishing, because on first glance it’s not clear. So that’s priority 1.

I’ll also leave a few comments on this PR—even if it gets reworked—just to give a sense of what we’re looking for when contributing to this project.

drwpow avatar May 16 '24 16:05 drwpow

any chance of this getting merged? i'm getting hit with this problem with a long-running fetch call (undici hardcodes the timeout when used through the fetch api)

mwotton avatar Jul 24 '24 08:07 mwotton

Apologies; I dropped off reviewing this PR because it still had failing tests, and it seemed like there was still work to be done. @mellster2012 if we get all the tests and checks passing again, I’d be open to approving and merging 🙂. Thanks for addressing my previous comments, by the way!

drwpow avatar Aug 01 '24 15:08 drwpow

Apologies; I dropped off reviewing this PR because it still had failing tests, and it seemed like there was still work to be done. @mellster2012 if we get all the tests and checks passing again, I’d be open to approving and merging 🙂. Thanks for addressing my previous comments, by the way!

Sure, I will definitely work on it and resubmit once everything is back in sync and tests are passing, but it may take a week or more until I can get started on it.

mellster2012 avatar Aug 05 '24 17:08 mellster2012

Redone PR here: https://github.com/openapi-ts/openapi-typescript/pull/1837

mellster2012 avatar Aug 10 '24 23:08 mellster2012