Skip to content

Commit

Permalink
internal/lsp: run internal/lsp/reset_golden.sh
Browse files Browse the repository at this point in the history
Run reset_golden.sh, so that our golden files are stable. This will be
useful later, when we migrate internal/lsp to gopls/internal/lsp, and
golden files must be updated to account for changing offsets.

For golang/go#54509

Change-Id: I2e9a8d3493d64d632b9f0f0e0360d633803f9d92
Reviewed-on: https://go-review.googlesource.com/c/tools/+/426797
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
  • Loading branch information
findleyr committed Aug 31, 2022
1 parent 248c34b commit ddbeb75
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 668 deletions.
10 changes: 9 additions & 1 deletion internal/lsp/reset_golden.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
#
# Copyright 2022 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
#
# Regenerates the *.golden files in the ./internal/lsp/testdata directory.

find ./internal/lsp/ -name *.golden -delete
set -eu

find ./internal/lsp/testdata -name *.golden ! -name summary*.txt.golden -delete
go test ./internal/lsp/source -golden
go test ./internal/lsp/ -golden
go test ./internal/lsp/cmd -golden
364 changes: 0 additions & 364 deletions internal/lsp/testdata/extract/extract_method/extract_basic.go.golden
Original file line number Diff line number Diff line change
Expand Up @@ -180,188 +180,6 @@ func (a A) Add() int {
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- functionextraction_extract_method_13_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := newFunction(a) //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func newFunction(a *A) int {
sum := a.x + a.y
return sum
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- functionextraction_extract_method_14_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return newFunction(sum) //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func newFunction(sum int) int {
return sum
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- functionextraction_extract_method_18_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) XLessThanY() bool {
return newFunction(a) //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func newFunction(a A) bool {
return a.x < a.y
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- functionextraction_extract_method_22_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := newFunction(a) //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func newFunction(a A) int {
sum := a.x + a.y
return sum
}

-- functionextraction_extract_method_23_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return newFunction(sum) //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func newFunction(sum int) int {
return sum
}

-- functionextraction_extract_method_9_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return newFunction(a) //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func newFunction(a *A) bool {
return a.x < a.y
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- methodextraction_extract_basic_13_2 --
package extract

Expand Down Expand Up @@ -544,185 +362,3 @@ func (a A) Add() int {
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- methodextraction_extract_method_13_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.newMethod() //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a *A) newMethod() int {
sum := a.x + a.y
return sum
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- methodextraction_extract_method_14_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return a.newMethod(sum) //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (*A) newMethod(sum int) int {
return sum
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- methodextraction_extract_method_18_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) XLessThanY() bool {
return a.newMethod() //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) newMethod() bool {
return a.x < a.y
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

-- methodextraction_extract_method_22_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.newMethod() //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) newMethod() int {
sum := a.x + a.y
return sum
}

-- methodextraction_extract_method_23_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return a.newMethod(sum) //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (A) newMethod(sum int) int {
return sum
}

-- methodextraction_extract_method_9_2 --
package extract

type A struct {
x int
y int
}

func (a *A) XLessThanYP() bool {
return a.newMethod() //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a *A) newMethod() bool {
return a.x < a.y
}

func (a *A) AddP() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

func (a A) XLessThanY() bool {
return a.x < a.y //@extractmethod("return", "a.y"),extractfunc("return", "a.y")
}

func (a A) Add() int {
sum := a.x + a.y //@extractmethod("sum", "a.y"),extractfunc("sum", "a.y")
return sum //@extractmethod("return", "sum"),extractfunc("return", "sum")
}

Loading

0 comments on commit ddbeb75

Please sign in to comment.