From 5cc2d0b12cd3eee183bbd2f3a901418f482d0579 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 26 Jun 2024 15:27:00 -0400 Subject: [PATCH] gopls/internal/golang: splitlines: remove workaround for golang/go#68202 There's no need for splitlines to handle FuncDecl since it handles FuncType... now that the bug in PathEnclosingInterval is fixed. Updates golang/go#68202 Change-Id: I3c96535b87c62e5d2a5b68ec66fed7df50b5d6c4 Reviewed-on: https://go-review.googlesource.com/c/tools/+/595196 LUCI-TryBot-Result: Go LUCI Reviewed-by: Robert Findley --- gopls/internal/golang/lines.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/gopls/internal/golang/lines.go b/gopls/internal/golang/lines.go index b22914166fc..736feaa1242 100644 --- a/gopls/internal/golang/lines.go +++ b/gopls/internal/golang/lines.go @@ -166,20 +166,8 @@ func findSplitJoinTarget(fset *token.FileSet, file *ast.File, src []byte, start, path, _ := astutil.PathEnclosingInterval(file, start, end) for _, node := range path { switch node := node.(type) { - case *ast.FuncDecl: - // target struct method declarations. - // function (...) someMethod(a int, b int, c int) (d int, e, int) {} - params := node.Type.Params - if isCursorInside(params.Opening, params.Closing) { - return "parameters", params, params.Opening, params.Closing - } - - results := node.Type.Results - if results != nil && isCursorInside(results.Opening, results.Closing) { - return "results", results, results.Opening, results.Closing - } case *ast.FuncType: - // target function signature args and result. + // target function signature parameters and results. // type someFunc func (a int, b int, c int) (d int, e int) params := node.Params if isCursorInside(params.Opening, params.Closing) {