Skip to content

Commit 5cc2d0b

Browse files
committed
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 <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 6916077 commit 5cc2d0b

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

gopls/internal/golang/lines.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,8 @@ func findSplitJoinTarget(fset *token.FileSet, file *ast.File, src []byte, start,
166166
path, _ := astutil.PathEnclosingInterval(file, start, end)
167167
for _, node := range path {
168168
switch node := node.(type) {
169-
case *ast.FuncDecl:
170-
// target struct method declarations.
171-
// function (...) someMethod(a int, b int, c int) (d int, e, int) {}
172-
params := node.Type.Params
173-
if isCursorInside(params.Opening, params.Closing) {
174-
return "parameters", params, params.Opening, params.Closing
175-
}
176-
177-
results := node.Type.Results
178-
if results != nil && isCursorInside(results.Opening, results.Closing) {
179-
return "results", results, results.Opening, results.Closing
180-
}
181169
case *ast.FuncType:
182-
// target function signature args and result.
170+
// target function signature parameters and results.
183171
// type someFunc func (a int, b int, c int) (d int, e int)
184172
params := node.Params
185173
if isCursorInside(params.Opening, params.Closing) {

0 commit comments

Comments
 (0)