X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fcoc-go-data%2Ftools%2Fpkg%2Fmod%2Fgolang.org%2Fx%2Ftools%40v0.0.0-20201105173854-bc9fc8d8c4bc%2Finternal%2Flsp%2Fcmd%2Ftest%2Fimplementation.go;fp=.config%2Fcoc%2Fextensions%2Fcoc-go-data%2Ftools%2Fpkg%2Fmod%2Fgolang.org%2Fx%2Ftools%40v0.0.0-20201105173854-bc9fc8d8c4bc%2Finternal%2Flsp%2Fcmd%2Ftest%2Fimplementation.go;h=189452466ceebea946d370f0ed8a7af9e799a220;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hp=0000000000000000000000000000000000000000;hpb=b3950616b54221c40a7dab9099bda675007e5b6e;p=dotfiles%2F.git diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/internal/lsp/cmd/test/implementation.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/internal/lsp/cmd/test/implementation.go new file mode 100644 index 00000000..18945246 --- /dev/null +++ b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/internal/lsp/cmd/test/implementation.go @@ -0,0 +1,37 @@ +// 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" + "sort" + "testing" + + "golang.org/x/tools/internal/span" +) + +func (r *runner) Implementation(t *testing.T, spn span.Span, imps []span.Span) { + var itemStrings []string + for _, i := range imps { + itemStrings = append(itemStrings, fmt.Sprint(i)) + } + sort.Strings(itemStrings) + var expect string + for _, i := range itemStrings { + expect += i + "\n" + } + expect = r.Normalize(expect) + + uri := spn.URI() + filename := uri.Filename() + target := filename + fmt.Sprintf(":%v:%v", spn.Start().Line(), spn.Start().Column()) + + got, stderr := r.NormalizeGoplsCmd(t, "implementation", target) + if stderr != "" { + t.Errorf("implementation failed for %s: %s", target, stderr) + } else if expect != got { + t.Errorf("implementation failed for %s expected:\n%s\ngot:\n%s", target, expect, got) + } +}