-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeRefactoringIssues related to refactoring toolsIssues related to refactoring toolsToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
gopls version
v14.2
go env
unimportantWhat did you do?
In the following example, select all main function body, then toggle "Extract function"
func main() {
var s []string
slices.SortFunc(s, func(a, b string) int {
return cmp.Compare(a, b)
})
println(s)
}What did you expect to see?
func main() {
newFunction()
}
func newFunction() {
var s []string
slices.SortFunc(s, func(a, b string) int {
return cmp.Compare(a, b)
})
println(s)
}What did you see instead?
func main() {
shouldReturn := newFunction()
if shouldReturn {
return
}
}
func newFunction() bool {
var s []string
slices.SortFunc(s, func(a, b string) int {
return true, cmp.Compare(a, b)
})
println(s)
return false
}Editor and settings
No response
Logs
No response
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeRefactoringIssues related to refactoring toolsIssues related to refactoring toolsToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.