Repository: go
Issue: x/tools/gopls: Session.SnapshotOf gets stuck
Labels: NeedsInvestigation

Recently, vscode has become unable to save files normally. Every time I try to save the file, there are will popup a dialog shown in the video below , and will not disappeared. 
`Saving 'xxx.go': Getting code actions from "Go"` 


https://github.com/golang/vscode-go/assets/779521/6e243ff7-565a-4d31-a722-f1c1a7bc118c

I have tried restarting and reinstalling vscode.  but failed to fix the problem.


### What version of Go, VS Code & VS Code Go extension are you using?
<details><summary>Version Information</summary><br>

* Run `go version` to get version of Go from _the VS Code integrated terminal_.
	- go version go1.22.1 darwin/arm64
* Run `gopls -v version` to get version of Gopls from _the VS Code integrated terminal_.
	- golang.org/x/tools/gopls v0.15.2
* Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders.
	- 1.87.2  arm64
* Check your installed extensions to get the version of the VS Code Go extension
	- <Paste Go extension version here>
* Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > `Go: Locate Configured Go Tools` command.
	# Tools Configuration


## Environment

GOBIN: undefined
toolsGopath: 
gopath: /Users/william/go
GOROOT: /usr/local/go
PATH: /Users/william/miniconda3/bin:/Users/william/miniconda3/condabin:/Users/william/.nvm/versions/node/v21.5.0/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/usr/local/go/bin:/Users/william/.cargo/bin:/Users/william/.orbstack/bin:/Users/william/go/bin:/bin:/Users/william/Library/Android/sdk/platform-tools:/Users/william/.dotnet/tools

## Tools

	go:	/usr/local/go/bin/go: go version go1.22.1 darwin/arm64

	gopls:	/Users/william/go/bin/gopls	(version: v0.15.2 built with go: go1.22.0)
	gotests:	/Users/william/go/bin/gotests	(version: v1.6.0 built with go: go1.22.0)
	gomodifytags:	/Users/william/go/bin/gomodifytags	(version: v1.16.0 built with go: go1.22.0)
	impl:	/Users/william/go/bin/impl	(version: v1.1.0 built with go: go1.22.0)
	goplay:	/Users/william/go/bin/goplay	(version: v1.0.0 built with go: go1.22.0)
	dlv:	not installed
	staticcheck:	/Users/william/go/bin/staticcheck	(version: v0.4.6 built with go: go1.22.0)

## Go env

Workspace Folder (canzhi-im): /Users/william/dev/github/williambao/canzhi-im

	GO111MODULE=''
	GOARCH='arm64'
	GOBIN=''
	GOCACHE='/Users/william/Library/Caches/go-build'
	GOENV='/Users/william/Library/Application Support/go/env'
	GOEXE=''
	GOEXPERIMENT=''
	GOFLAGS=''
	GOHOSTARCH='arm64'
	GOHOSTOS='darwin'
	GOINSECURE=''
	GOMODCACHE='/Users/william/go/pkg/mod'
	GONOPROXY=''
	GONOSUMDB=''
	GOOS='darwin'
	GOPATH='/Users/william/go'
	GOPRIVATE=''
	GOPROXY='https://proxy.golang.org,direct'
	GOROOT='/usr/local/go'
	GOSUMDB='sum.golang.org'
	GOTMPDIR=''
	GOTOOLCHAIN='auto'
	GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
	GOVCS=''
	GOVERSION='go1.22.1'
	GCCGO='gccgo'
	AR='ar'
	CC='clang'
	CXX='clang++'
	CGO_ENABLED='1'
	GOMOD='/Users/william/dev/github/williambao/im/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/sf/wbbbs495291983m1ccsbrzp80000gn/T/go-build3655270104=/tmp/go-build -gno-record-gcc-switches -fno-common'
	
</details>