some deletions
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / internal / lsp / cmd / test / definition.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201028153306-37f0764111ff/internal/lsp/cmd/test/definition.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201028153306-37f0764111ff/internal/lsp/cmd/test/definition.go
deleted file mode 100644 (file)
index 62ff22f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2019 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.
-
-package cmdtest
-
-import (
-       "fmt"
-       "runtime"
-       "strings"
-       "testing"
-
-       "golang.org/x/tools/internal/lsp/diff"
-       "golang.org/x/tools/internal/lsp/diff/myers"
-       "golang.org/x/tools/internal/lsp/tests"
-       "golang.org/x/tools/internal/span"
-)
-
-type godefMode int
-
-const (
-       plainGodef = godefMode(1 << iota)
-       jsonGoDef
-)
-
-var godefModes = []godefMode{
-       plainGodef,
-       jsonGoDef,
-}
-
-func (r *runner) Definition(t *testing.T, spn span.Span, d tests.Definition) {
-       if d.IsType || d.OnlyHover {
-               // TODO: support type definition, hover queries
-               return
-       }
-       d.Src = span.New(d.Src.URI(), span.NewPoint(0, 0, d.Src.Start().Offset()), span.Point{})
-       for _, mode := range godefModes {
-               args := []string{"definition", "-markdown"}
-               tag := d.Name + "-definition"
-               if mode&jsonGoDef != 0 {
-                       tag += "-json"
-                       args = append(args, "-json")
-               }
-               uri := d.Src.URI()
-               args = append(args, fmt.Sprint(d.Src))
-               got, _ := r.NormalizeGoplsCmd(t, args...)
-               if mode&jsonGoDef != 0 && runtime.GOOS == "windows" {
-                       got = strings.Replace(got, "file:///", "file://", -1)
-               }
-               expect := strings.TrimSpace(string(r.data.Golden(tag, uri.Filename(), func() ([]byte, error) {
-                       return []byte(got), nil
-               })))
-               if expect != "" && !strings.HasPrefix(got, expect) {
-                       d := myers.ComputeEdits("", expect, got)
-                       t.Errorf("definition %v failed with %#v\n%s", tag, args, diff.ToUnified("expect", "got", expect, d))
-               }
-       }
-}