Repository: go
Issue: x/tools/gopls: codeAction/resolve can result in applied edits
Labels: gopls,Tools

<!--
For asking questions, see:
- [Stack Overflow](https://stackoverflow.com/questions/tagged/go+visual-studio-code)
- [GitHub Discussions (Help)](https://github.com/golang/vscode-go/discussions/categories/help)
- [`#vscode` channel in Gophers Slack](https://invite.slack.golangbridge.org/messages/vscode)

Before filing an issue, please review our troubleshooting guides
* [Troubleshooting problems with debugging](https://github.com/golang/vscode-go/wiki/debugging#troubleshooting)
* [Troubleshooting other problems](https://github.com/golang/vscode-go/wiki/troubleshooting)

Please answer these questions before submitting your issue. Thanks!
-->

### 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.23.4 darwin/arm64
* Run `gopls -v version` to get version of Gopls from _the VS Code integrated terminal_.
	- gopls(v0.17.1/go1.23.4)
* Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders.
	- 1.96.3
91fbdddc47bc9c09064bf7acf133d22631cbf083
arm64
* Check your installed extensions to get the version of the VS Code Go extension
	- 0.44.0
* Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > `Go: Locate Configured Go Tools` command.
	- # Tools Configuration


## Environment

GOBIN: undefined
toolsGopath: 
gopath: /Users/kristopherjohnson/go
GOROOT: /opt/homebrew/Cellar/go/1.23.4/libexec
PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/Users/kristopherjohnson/.vscode-dotnet-sdk/.dotnet:/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:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands

## Tools

	go:	/opt/homebrew/bin/go: go version go1.23.4 darwin/arm64

	gopls:	/Users/kristopherjohnson/go/bin/gopls	(version: v0.17.1 built with go: go1.23.4)
	gotests:	/Users/kristopherjohnson/go/bin/gotests	(version: v1.6.0 built with go: go1.23.4)
	gomodifytags:	/Users/kristopherjohnson/go/bin/gomodifytags	(version: v1.17.0 built with go: go1.23.4)
	impl:	/Users/kristopherjohnson/go/bin/impl	(version: v1.4.0 built with go: go1.23.4)
	goplay:	/Users/kristopherjohnson/go/bin/goplay	(version: v1.0.0 built with go: go1.23.4)
	dlv:	/Users/kristopherjohnson/go/bin/dlv	(version: v1.24.0 built with go: go1.23.4)
	staticcheck:	/Users/kristopherjohnson/go/bin/staticcheck	(version: v0.5.1 built with go: go1.23.4)

## Go env

Workspace Folder (no folder): undefined

	GO111MODULE=''
	GOARCH='arm64'
	GOBIN=''
	GOCACHE='/Users/kristopherjohnson/Library/Caches/go-build'
	GOENV='/Users/kristopherjohnson/Library/Application Support/go/env'
	GOEXE=''
	GOEXPERIMENT=''
	GOFLAGS=''
	GOHOSTARCH='arm64'
	GOHOSTOS='darwin'
	GOINSECURE=''
	GOMODCACHE='/Users/kristopherjohnson/go/pkg/mod'
	GONOPROXY='github.com/Think-Org/*'
	GONOSUMDB='github.com/Think-Org/*'
	GOOS='darwin'
	GOPATH='/Users/kristopherjohnson/go'
	GOPRIVATE='github.com/Think-Org/*'
	GOPROXY='https://proxy.golang.org,direct'
	GOROOT='/opt/homebrew/Cellar/go/1.23.4/libexec'
	GOSUMDB='sum.golang.org'
	GOTMPDIR=''
	GOTOOLCHAIN='local'
	GOTOOLDIR='/opt/homebrew/Cellar/go/1.23.4/libexec/pkg/tool/darwin_arm64'
	GOVCS=''
	GOVERSION='go1.23.4'
	GODEBUG=''
	GOTELEMETRY='local'
	GOTELEMETRYDIR='/Users/kristopherjohnson/Library/Application Support/go/telemetry'
	GCCGO='gccgo'
	GOARM64='v8.0'
	AR='ar'
	CC='cc'
	CXX='c++'
	CGO_ENABLED='1'
	GOMOD='/dev/null'
	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/1x/yh177xs1437bszk53phkfbdm0000gn/T/go-build1293292670=/tmp/go-build -gno-record-gcc-switches -fno-common'
	
</details>

### Share the Go related settings you have added/edited

Run `Preferences: Open Settings (JSON)` command to open your settings.json file.
Share all the settings with the `go.` or `["go"]` or `gopls` prefixes.

```json
"go.toolsManagement.autoUpdate": true,
    "gopls": {
        "ui.semanticTokens": true
    },
    "[go]": {
        "editor.insertSpaces": false,
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": "always",
        }
    }
```

### Describe the bug
A clear and concise description of what the bug:
- When participating in a liveshare session:
  - when clicking on a function (but sometimes anywhere in a file or just the file itself), a test file is generated with tests for the function/file clicked
- when clicking on a function, the function is extracted to a separate file

A clear and concise description of what you expected to happen:
- Test generation and function extraction should only occur when selected from the context menu/command palate

### Steps to reproduce the behavior:
Scenario 1
1. Go to file in a liveshare session
2. Click on a existing function in the file
3. See that the the function is extracted to a separate file

Scenario 2
1. Go to file in a liveshare session
2. Click on an existing file in the file explorer
3. See that a file is created with unit tests for all the functions in the file selected

### Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.

https://github.com/user-attachments/assets/4d168273-cd4b-416d-8196-35bcc9a6beea