gopls/internal/span: move internal/span into gopls
Spans are logically part of gopls, but could not be moved
into the gopls module because of a number of depenencies
from packagestest, analysis, and internal/diff.
Those edges are now broken.
Change-Id: Icba5ebec6b27974f832a1186120a4b87d5f87103
Reviewed-on: https://go-review.googlesource.com/c/tools/+/440176
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/gopls/doc/design/integrating.md b/gopls/doc/design/integrating.md
index 7937ba8..ba2cc07 100644
--- a/gopls/doc/design/integrating.md
+++ b/gopls/doc/design/integrating.md
@@ -20,7 +20,7 @@
This means that integrators will need to calculate UTF-16 based column offsets.
-[`golang.org/x/tools/internal/span`] has the code to do this in go.
+[`golang.org/x/tools/gopls/internal/span`] has the code to do this in go.
[#31080] tracks making `span` and other useful packages non-internal.
## Edits
@@ -63,7 +63,7 @@
[InitializeResult]: https://pkg.go.dev/golang.org/x/tools/gopls/internal/lsp/protocol#InitializeResult
[ServerCapabilities]: https://pkg.go.dev/golang.org/x/tools/gopls/internal/lsp/protocol#ServerCapabilities
-[`golang.org/x/tools/internal/span`]: https://pkg.go.dev/golang.org/x/tools/internal/span#NewPoint
+[`golang.org/x/tools/gopls/internal/span`]: https://pkg.go.dev/golang.org/x/tools/internal/span#NewPoint
[LSP specification]: https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/
[lsp-response]: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md#response-message
diff --git a/gopls/internal/lsp/analysis/fillstruct/fillstruct.go b/gopls/internal/lsp/analysis/fillstruct/fillstruct.go
index 931b219..faf5ba5 100644
--- a/gopls/internal/lsp/analysis/fillstruct/fillstruct.go
+++ b/gopls/internal/lsp/analysis/fillstruct/fillstruct.go
@@ -26,9 +26,9 @@
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/ast/inspector"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/analysisinternal"
"golang.org/x/tools/internal/fuzzy"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/typeparams"
)
diff --git a/gopls/internal/lsp/analysis/undeclaredname/undeclared.go b/gopls/internal/lsp/analysis/undeclaredname/undeclared.go
index eaecc8f..fd8d35e 100644
--- a/gopls/internal/lsp/analysis/undeclaredname/undeclared.go
+++ b/gopls/internal/lsp/analysis/undeclaredname/undeclared.go
@@ -18,8 +18,8 @@
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/ast/astutil"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/analysisinternal"
- "golang.org/x/tools/internal/span"
)
const Doc = `suggested fixes for "undeclared name: <>"
diff --git a/gopls/internal/lsp/cache/analysis.go b/gopls/internal/lsp/cache/analysis.go
index ffd1405..95bac5b 100644
--- a/gopls/internal/lsp/cache/analysis.go
+++ b/gopls/internal/lsp/cache/analysis.go
@@ -16,12 +16,12 @@
"golang.org/x/sync/errgroup"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/analysisinternal"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/internal/memoize"
- "golang.org/x/tools/internal/span"
)
func (s *snapshot) Analyze(ctx context.Context, id string, analyzers []*source.Analyzer) ([]*source.Diagnostic, error) {
diff --git a/gopls/internal/lsp/cache/cache.go b/gopls/internal/lsp/cache/cache.go
index 5056111..0eb00f2 100644
--- a/gopls/internal/lsp/cache/cache.go
+++ b/gopls/internal/lsp/cache/cache.go
@@ -20,12 +20,12 @@
"sync/atomic"
"time"
- "golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/gocommand"
- "golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/event"
+ "golang.org/x/tools/internal/event/tag"
+ "golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/internal/memoize"
- "golang.org/x/tools/internal/span"
)
// New Creates a new cache for gopls operation results, using the given file
diff --git a/gopls/internal/lsp/cache/check.go b/gopls/internal/lsp/cache/check.go
index 7058394..0b37135 100644
--- a/gopls/internal/lsp/cache/check.go
+++ b/gopls/internal/lsp/cache/check.go
@@ -23,12 +23,12 @@
"golang.org/x/tools/go/packages"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/internal/memoize"
"golang.org/x/tools/internal/packagesinternal"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/typeparams"
"golang.org/x/tools/internal/typesinternal"
)
diff --git a/gopls/internal/lsp/cache/errors.go b/gopls/internal/lsp/cache/errors.go
index d01bf7f..1c38e20 100644
--- a/gopls/internal/lsp/cache/errors.go
+++ b/gopls/internal/lsp/cache/errors.go
@@ -15,12 +15,12 @@
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/packages"
- "golang.org/x/tools/internal/analysisinternal"
- "golang.org/x/tools/internal/bug"
"golang.org/x/tools/gopls/internal/lsp/command"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/analysisinternal"
+ "golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/typesinternal"
)
diff --git a/gopls/internal/lsp/cache/graph.go b/gopls/internal/lsp/cache/graph.go
index f90ee96..a801c83 100644
--- a/gopls/internal/lsp/cache/graph.go
+++ b/gopls/internal/lsp/cache/graph.go
@@ -8,7 +8,7 @@
"sort"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// A metadataGraph is an immutable and transitively closed import
diff --git a/gopls/internal/lsp/cache/load.go b/gopls/internal/lsp/cache/load.go
index 287c310..a77afaa 100644
--- a/gopls/internal/lsp/cache/load.go
+++ b/gopls/internal/lsp/cache/load.go
@@ -19,11 +19,11 @@
"golang.org/x/tools/go/packages"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/internal/packagesinternal"
- "golang.org/x/tools/internal/span"
)
var loadID uint64 // atomic identifier for loads
diff --git a/gopls/internal/lsp/cache/maps.go b/gopls/internal/lsp/cache/maps.go
index d3fe4e4..edb8d16 100644
--- a/gopls/internal/lsp/cache/maps.go
+++ b/gopls/internal/lsp/cache/maps.go
@@ -6,8 +6,8 @@
import (
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/persistent"
- "golang.org/x/tools/internal/span"
)
// TODO(euroelessar): Use generics once support for go1.17 is dropped.
diff --git a/gopls/internal/lsp/cache/metadata.go b/gopls/internal/lsp/cache/metadata.go
index 7778996..66c679b 100644
--- a/gopls/internal/lsp/cache/metadata.go
+++ b/gopls/internal/lsp/cache/metadata.go
@@ -8,8 +8,8 @@
"go/types"
"golang.org/x/tools/go/packages"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/packagesinternal"
- "golang.org/x/tools/internal/span"
)
// Declare explicit types for package paths, names, and IDs to ensure that we
diff --git a/gopls/internal/lsp/cache/mod.go b/gopls/internal/lsp/cache/mod.go
index 50fa0a4..f8404e7 100644
--- a/gopls/internal/lsp/cache/mod.go
+++ b/gopls/internal/lsp/cache/mod.go
@@ -14,14 +14,14 @@
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
- "golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/gopls/internal/lsp/command"
- "golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/event"
+ "golang.org/x/tools/internal/event/tag"
+ "golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/internal/memoize"
- "golang.org/x/tools/internal/span"
)
// ParseMod parses a go.mod file, using a cache. It may return partial results and an error.
diff --git a/gopls/internal/lsp/cache/mod_tidy.go b/gopls/internal/lsp/cache/mod_tidy.go
index e471a9b..63346dc 100644
--- a/gopls/internal/lsp/cache/mod_tidy.go
+++ b/gopls/internal/lsp/cache/mod_tidy.go
@@ -19,11 +19,11 @@
"golang.org/x/tools/gopls/internal/lsp/command"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/internal/memoize"
- "golang.org/x/tools/internal/span"
)
// ModTidy returns the go.mod file that would be obtained by running
diff --git a/gopls/internal/lsp/cache/pkg.go b/gopls/internal/lsp/cache/pkg.go
index b1ee50e..76e29ee 100644
--- a/gopls/internal/lsp/cache/pkg.go
+++ b/gopls/internal/lsp/cache/pkg.go
@@ -12,7 +12,7 @@
"golang.org/x/mod/module"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// pkg contains the type information needed by the source package.
diff --git a/gopls/internal/lsp/cache/session.go b/gopls/internal/lsp/cache/session.go
index 8a45ae2..cb18834 100644
--- a/gopls/internal/lsp/cache/session.go
+++ b/gopls/internal/lsp/cache/session.go
@@ -16,11 +16,11 @@
"golang.org/x/tools/gopls/internal/lsp/command"
"golang.org/x/tools/gopls/internal/lsp/progress"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/internal/imports"
"golang.org/x/tools/internal/persistent"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/xcontext"
)
diff --git a/gopls/internal/lsp/cache/snapshot.go b/gopls/internal/lsp/cache/snapshot.go
index fb4e78b..8027b40 100644
--- a/gopls/internal/lsp/cache/snapshot.go
+++ b/gopls/internal/lsp/cache/snapshot.go
@@ -32,6 +32,7 @@
"golang.org/x/sync/errgroup"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
@@ -39,7 +40,6 @@
"golang.org/x/tools/internal/memoize"
"golang.org/x/tools/internal/packagesinternal"
"golang.org/x/tools/internal/persistent"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/typesinternal"
)
diff --git a/gopls/internal/lsp/cache/view.go b/gopls/internal/lsp/cache/view.go
index af4ab9a..7d3cba3 100644
--- a/gopls/internal/lsp/cache/view.go
+++ b/gopls/internal/lsp/cache/view.go
@@ -27,11 +27,11 @@
"golang.org/x/tools/gopls/internal/lsp/command"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/internal/imports"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/xcontext"
)
diff --git a/gopls/internal/lsp/cache/view_test.go b/gopls/internal/lsp/cache/view_test.go
index f3851e9..99daff1 100644
--- a/gopls/internal/lsp/cache/view_test.go
+++ b/gopls/internal/lsp/cache/view_test.go
@@ -12,7 +12,7 @@
"golang.org/x/tools/gopls/internal/lsp/fake"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func TestCaseInsensitiveFilesystem(t *testing.T) {
diff --git a/gopls/internal/lsp/cache/workspace.go b/gopls/internal/lsp/cache/workspace.go
index e066c7e..2020718 100644
--- a/gopls/internal/lsp/cache/workspace.go
+++ b/gopls/internal/lsp/cache/workspace.go
@@ -15,9 +15,9 @@
"sync"
"golang.org/x/mod/modfile"
- "golang.org/x/tools/internal/event"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/xcontext"
)
diff --git a/gopls/internal/lsp/cache/workspace_test.go b/gopls/internal/lsp/cache/workspace_test.go
index e6047a9..37e8f2c 100644
--- a/gopls/internal/lsp/cache/workspace_test.go
+++ b/gopls/internal/lsp/cache/workspace_test.go
@@ -14,7 +14,7 @@
"golang.org/x/mod/modfile"
"golang.org/x/tools/gopls/internal/lsp/fake"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// osFileSource is a fileSource that just reads from the operating system.
diff --git a/gopls/internal/lsp/cmd/call_hierarchy.go b/gopls/internal/lsp/cmd/call_hierarchy.go
index 643b2f7..7736eec 100644
--- a/gopls/internal/lsp/cmd/call_hierarchy.go
+++ b/gopls/internal/lsp/cmd/call_hierarchy.go
@@ -11,7 +11,7 @@
"strings"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/check.go b/gopls/internal/lsp/cmd/check.go
index 9a13669..5e4fe39 100644
--- a/gopls/internal/lsp/cmd/check.go
+++ b/gopls/internal/lsp/cmd/check.go
@@ -9,7 +9,7 @@
"flag"
"fmt"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// check implements the check verb for gopls.
diff --git a/gopls/internal/lsp/cmd/cmd.go b/gopls/internal/lsp/cmd/cmd.go
index 824382d..38accb6 100644
--- a/gopls/internal/lsp/cmd/cmd.go
+++ b/gopls/internal/lsp/cmd/cmd.go
@@ -28,8 +28,8 @@
"golang.org/x/tools/gopls/internal/lsp/lsprpc"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/jsonrpc2"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/tool"
"golang.org/x/tools/internal/xcontext"
)
diff --git a/gopls/internal/lsp/cmd/definition.go b/gopls/internal/lsp/cmd/definition.go
index 3c4474a..9096e17 100644
--- a/gopls/internal/lsp/cmd/definition.go
+++ b/gopls/internal/lsp/cmd/definition.go
@@ -14,7 +14,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/folding_range.go b/gopls/internal/lsp/cmd/folding_range.go
index ee40715..17cead9 100644
--- a/gopls/internal/lsp/cmd/folding_range.go
+++ b/gopls/internal/lsp/cmd/folding_range.go
@@ -10,7 +10,7 @@
"fmt"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/format.go b/gopls/internal/lsp/cmd/format.go
index 56e3905..2f3b682 100644
--- a/gopls/internal/lsp/cmd/format.go
+++ b/gopls/internal/lsp/cmd/format.go
@@ -12,8 +12,8 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/diff"
- "golang.org/x/tools/internal/span"
)
// format implements the format verb for gopls.
diff --git a/gopls/internal/lsp/cmd/highlight.go b/gopls/internal/lsp/cmd/highlight.go
index ace8125..dcbd109 100644
--- a/gopls/internal/lsp/cmd/highlight.go
+++ b/gopls/internal/lsp/cmd/highlight.go
@@ -11,7 +11,7 @@
"sort"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/implementation.go b/gopls/internal/lsp/cmd/implementation.go
index 073a61a..259b725 100644
--- a/gopls/internal/lsp/cmd/implementation.go
+++ b/gopls/internal/lsp/cmd/implementation.go
@@ -11,7 +11,7 @@
"sort"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/imports.go b/gopls/internal/lsp/cmd/imports.go
index 4ee6fce..c041eee 100644
--- a/gopls/internal/lsp/cmd/imports.go
+++ b/gopls/internal/lsp/cmd/imports.go
@@ -12,8 +12,8 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/diff"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/links.go b/gopls/internal/lsp/cmd/links.go
index d63ac21..aec36da 100644
--- a/gopls/internal/lsp/cmd/links.go
+++ b/gopls/internal/lsp/cmd/links.go
@@ -12,7 +12,7 @@
"os"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/prepare_rename.go b/gopls/internal/lsp/cmd/prepare_rename.go
index 7dfac9b..434904b 100644
--- a/gopls/internal/lsp/cmd/prepare_rename.go
+++ b/gopls/internal/lsp/cmd/prepare_rename.go
@@ -11,7 +11,7 @@
"fmt"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/references.go b/gopls/internal/lsp/cmd/references.go
index 13c30bd..bbebc9f 100644
--- a/gopls/internal/lsp/cmd/references.go
+++ b/gopls/internal/lsp/cmd/references.go
@@ -11,7 +11,7 @@
"sort"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/rename.go b/gopls/internal/lsp/cmd/rename.go
index 58fb07d..ceca734 100644
--- a/gopls/internal/lsp/cmd/rename.go
+++ b/gopls/internal/lsp/cmd/rename.go
@@ -15,8 +15,8 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/diff"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/semantictokens.go b/gopls/internal/lsp/cmd/semantictokens.go
index 547b019..f90d49c 100644
--- a/gopls/internal/lsp/cmd/semantictokens.go
+++ b/gopls/internal/lsp/cmd/semantictokens.go
@@ -19,7 +19,7 @@
"golang.org/x/tools/gopls/internal/lsp"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// generate semantic tokens and interpolate them in the file
diff --git a/gopls/internal/lsp/cmd/signature.go b/gopls/internal/lsp/cmd/signature.go
index 81ec4fe..657d772 100644
--- a/gopls/internal/lsp/cmd/signature.go
+++ b/gopls/internal/lsp/cmd/signature.go
@@ -10,7 +10,7 @@
"fmt"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/suggested_fix.go b/gopls/internal/lsp/cmd/suggested_fix.go
index 9c103de..6d42a67 100644
--- a/gopls/internal/lsp/cmd/suggested_fix.go
+++ b/gopls/internal/lsp/cmd/suggested_fix.go
@@ -12,8 +12,8 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/diff"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/symbols.go b/gopls/internal/lsp/cmd/symbols.go
index 0d6e4db..3ecdff8 100644
--- a/gopls/internal/lsp/cmd/symbols.go
+++ b/gopls/internal/lsp/cmd/symbols.go
@@ -12,7 +12,7 @@
"sort"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/test/call_hierarchy.go b/gopls/internal/lsp/cmd/test/call_hierarchy.go
index be4ebe8..bb8d306 100644
--- a/gopls/internal/lsp/cmd/test/call_hierarchy.go
+++ b/gopls/internal/lsp/cmd/test/call_hierarchy.go
@@ -12,7 +12,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/tests"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) CallHierarchy(t *testing.T, spn span.Span, expectedCalls *tests.CallHierarchyResult) {
diff --git a/gopls/internal/lsp/cmd/test/check.go b/gopls/internal/lsp/cmd/test/check.go
index 819863d..ea9747c 100644
--- a/gopls/internal/lsp/cmd/test/check.go
+++ b/gopls/internal/lsp/cmd/test/check.go
@@ -12,7 +12,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/tests"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// Diagnostics runs the gopls command on a single file, parses its
diff --git a/gopls/internal/lsp/cmd/test/cmdtest.go b/gopls/internal/lsp/cmd/test/cmdtest.go
index e2a3e54..167631a 100644
--- a/gopls/internal/lsp/cmd/test/cmdtest.go
+++ b/gopls/internal/lsp/cmd/test/cmdtest.go
@@ -23,8 +23,8 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/tests"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/jsonrpc2/servertest"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/tool"
)
diff --git a/gopls/internal/lsp/cmd/test/definition.go b/gopls/internal/lsp/cmd/test/definition.go
index 6241867..ca84e80 100644
--- a/gopls/internal/lsp/cmd/test/definition.go
+++ b/gopls/internal/lsp/cmd/test/definition.go
@@ -11,7 +11,7 @@
"testing"
"golang.org/x/tools/gopls/internal/lsp/tests"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
type godefMode int
diff --git a/gopls/internal/lsp/cmd/test/folding_range.go b/gopls/internal/lsp/cmd/test/folding_range.go
index ac41697..184c01a 100644
--- a/gopls/internal/lsp/cmd/test/folding_range.go
+++ b/gopls/internal/lsp/cmd/test/folding_range.go
@@ -7,7 +7,7 @@
import (
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) FoldingRanges(t *testing.T, spn span.Span) {
diff --git a/gopls/internal/lsp/cmd/test/format.go b/gopls/internal/lsp/cmd/test/format.go
index 6523e66..368d535 100644
--- a/gopls/internal/lsp/cmd/test/format.go
+++ b/gopls/internal/lsp/cmd/test/format.go
@@ -14,7 +14,7 @@
exec "golang.org/x/sys/execabs"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/testenv"
)
diff --git a/gopls/internal/lsp/cmd/test/highlight.go b/gopls/internal/lsp/cmd/test/highlight.go
index 99e8b2c..cd51b09 100644
--- a/gopls/internal/lsp/cmd/test/highlight.go
+++ b/gopls/internal/lsp/cmd/test/highlight.go
@@ -9,7 +9,7 @@
"fmt"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) Highlight(t *testing.T, spn span.Span, spans []span.Span) {
diff --git a/gopls/internal/lsp/cmd/test/implementation.go b/gopls/internal/lsp/cmd/test/implementation.go
index 1894524..e24584d 100644
--- a/gopls/internal/lsp/cmd/test/implementation.go
+++ b/gopls/internal/lsp/cmd/test/implementation.go
@@ -9,7 +9,7 @@
"sort"
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) Implementation(t *testing.T, spn span.Span, imps []span.Span) {
diff --git a/gopls/internal/lsp/cmd/test/imports.go b/gopls/internal/lsp/cmd/test/imports.go
index eab4668..5659291 100644
--- a/gopls/internal/lsp/cmd/test/imports.go
+++ b/gopls/internal/lsp/cmd/test/imports.go
@@ -7,8 +7,8 @@
import (
"testing"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/diff"
- "golang.org/x/tools/internal/span"
)
func (r *runner) Import(t *testing.T, spn span.Span) {
diff --git a/gopls/internal/lsp/cmd/test/links.go b/gopls/internal/lsp/cmd/test/links.go
index 52d2a31..a9616ee 100644
--- a/gopls/internal/lsp/cmd/test/links.go
+++ b/gopls/internal/lsp/cmd/test/links.go
@@ -10,7 +10,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/tests"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) Link(t *testing.T, uri span.URI, wantLinks []tests.Link) {
diff --git a/gopls/internal/lsp/cmd/test/prepare_rename.go b/gopls/internal/lsp/cmd/test/prepare_rename.go
index 4ae6d1a..c818c01 100644
--- a/gopls/internal/lsp/cmd/test/prepare_rename.go
+++ b/gopls/internal/lsp/cmd/test/prepare_rename.go
@@ -11,7 +11,7 @@
"golang.org/x/tools/gopls/internal/lsp/cmd"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) PrepareRename(t *testing.T, src span.Span, want *source.PrepareItem) {
diff --git a/gopls/internal/lsp/cmd/test/references.go b/gopls/internal/lsp/cmd/test/references.go
index 66d0d06..85c9bc8 100644
--- a/gopls/internal/lsp/cmd/test/references.go
+++ b/gopls/internal/lsp/cmd/test/references.go
@@ -9,7 +9,7 @@
"sort"
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) References(t *testing.T, spn span.Span, itemList []span.Span) {
diff --git a/gopls/internal/lsp/cmd/test/rename.go b/gopls/internal/lsp/cmd/test/rename.go
index 4748c47..0750d70 100644
--- a/gopls/internal/lsp/cmd/test/rename.go
+++ b/gopls/internal/lsp/cmd/test/rename.go
@@ -8,7 +8,7 @@
"fmt"
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) Rename(t *testing.T, spn span.Span, newText string) {
diff --git a/gopls/internal/lsp/cmd/test/semanticdriver.go b/gopls/internal/lsp/cmd/test/semanticdriver.go
index 24a1fbf..069dd64 100644
--- a/gopls/internal/lsp/cmd/test/semanticdriver.go
+++ b/gopls/internal/lsp/cmd/test/semanticdriver.go
@@ -8,7 +8,7 @@
"strings"
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) SemanticTokens(t *testing.T, spn span.Span) {
diff --git a/gopls/internal/lsp/cmd/test/signature.go b/gopls/internal/lsp/cmd/test/signature.go
index 273e634..40669e8 100644
--- a/gopls/internal/lsp/cmd/test/signature.go
+++ b/gopls/internal/lsp/cmd/test/signature.go
@@ -10,7 +10,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/tests"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) SignatureHelp(t *testing.T, spn span.Span, want *protocol.SignatureHelp) {
diff --git a/gopls/internal/lsp/cmd/test/suggested_fix.go b/gopls/internal/lsp/cmd/test/suggested_fix.go
index 6d67f28..1e61fe9 100644
--- a/gopls/internal/lsp/cmd/test/suggested_fix.go
+++ b/gopls/internal/lsp/cmd/test/suggested_fix.go
@@ -10,7 +10,7 @@
"golang.org/x/tools/gopls/internal/lsp/tests"
"golang.org/x/tools/gopls/internal/lsp/tests/compare"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) SuggestedFix(t *testing.T, spn span.Span, suggestedFixes []tests.SuggestedFix, expectedActions int) {
diff --git a/gopls/internal/lsp/cmd/test/symbols.go b/gopls/internal/lsp/cmd/test/symbols.go
index 3bd2fc0..aaf3725 100644
--- a/gopls/internal/lsp/cmd/test/symbols.go
+++ b/gopls/internal/lsp/cmd/test/symbols.go
@@ -9,7 +9,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/tests/compare"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) Symbols(t *testing.T, uri span.URI, expectedSymbols []protocol.DocumentSymbol) {
diff --git a/gopls/internal/lsp/cmd/test/workspace_symbol.go b/gopls/internal/lsp/cmd/test/workspace_symbol.go
index 4c19d1d..40c2c65 100644
--- a/gopls/internal/lsp/cmd/test/workspace_symbol.go
+++ b/gopls/internal/lsp/cmd/test/workspace_symbol.go
@@ -14,7 +14,7 @@
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/tests"
"golang.org/x/tools/gopls/internal/lsp/tests/compare"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) WorkspaceSymbols(t *testing.T, uri span.URI, query string, typ tests.WorkspaceSymbolsTestType) {
diff --git a/gopls/internal/lsp/code_action.go b/gopls/internal/lsp/code_action.go
index e1f0dc2..1ad0cb4 100644
--- a/gopls/internal/lsp/code_action.go
+++ b/gopls/internal/lsp/code_action.go
@@ -14,10 +14,10 @@
"golang.org/x/tools/gopls/internal/lsp/mod"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/internal/imports"
- "golang.org/x/tools/internal/span"
)
func (s *Server) codeAction(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error) {
diff --git a/gopls/internal/lsp/command.go b/gopls/internal/lsp/command.go
index cb4c698..7f7380e 100644
--- a/gopls/internal/lsp/command.go
+++ b/gopls/internal/lsp/command.go
@@ -25,10 +25,10 @@
"golang.org/x/tools/gopls/internal/lsp/progress"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/gopls/internal/vulncheck"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/gocommand"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/xcontext"
)
diff --git a/gopls/internal/lsp/completion_test.go b/gopls/internal/lsp/completion_test.go
index 98d92b9..23d69ed 100644
--- a/gopls/internal/lsp/completion_test.go
+++ b/gopls/internal/lsp/completion_test.go
@@ -11,7 +11,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/tests"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (r *runner) Completion(t *testing.T, src span.Span, test tests.Completion, items tests.CompletionItems) {
diff --git a/gopls/internal/lsp/diagnostics.go b/gopls/internal/lsp/diagnostics.go
index 3efcaff..f6f9f79 100644
--- a/gopls/internal/lsp/diagnostics.go
+++ b/gopls/internal/lsp/diagnostics.go
@@ -21,9 +21,9 @@
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/template"
"golang.org/x/tools/gopls/internal/lsp/work"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/xcontext"
)
diff --git a/gopls/internal/lsp/fake/editor.go b/gopls/internal/lsp/fake/editor.go
index e65db93..d9e6c70 100644
--- a/gopls/internal/lsp/fake/editor.go
+++ b/gopls/internal/lsp/fake/editor.go
@@ -19,9 +19,9 @@
"golang.org/x/tools/gopls/internal/lsp/command"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/jsonrpc2"
"golang.org/x/tools/internal/jsonrpc2/servertest"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/xcontext"
)
diff --git a/gopls/internal/lsp/fake/workdir.go b/gopls/internal/lsp/fake/workdir.go
index 6530260..3f17cb6 100644
--- a/gopls/internal/lsp/fake/workdir.go
+++ b/gopls/internal/lsp/fake/workdir.go
@@ -18,7 +18,7 @@
"time"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// FileEvent wraps the protocol.FileEvent so that it can be associated with a
diff --git a/gopls/internal/lsp/general.go b/gopls/internal/lsp/general.go
index 01f8242..eee946e 100644
--- a/gopls/internal/lsp/general.go
+++ b/gopls/internal/lsp/general.go
@@ -18,10 +18,10 @@
"golang.org/x/tools/gopls/internal/lsp/debug"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/jsonrpc2"
- "golang.org/x/tools/internal/span"
)
func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error) {
diff --git a/gopls/internal/lsp/link.go b/gopls/internal/lsp/link.go
index 456f417..929fe28 100644
--- a/gopls/internal/lsp/link.go
+++ b/gopls/internal/lsp/link.go
@@ -17,11 +17,11 @@
"sync"
"golang.org/x/mod/modfile"
- "golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/event"
+ "golang.org/x/tools/internal/event/tag"
)
func (s *Server) documentLink(ctx context.Context, params *protocol.DocumentLinkParams) (links []protocol.DocumentLink, err error) {
diff --git a/gopls/internal/lsp/lsp_test.go b/gopls/internal/lsp/lsp_test.go
index 4cd009d..ce1aac4 100644
--- a/gopls/internal/lsp/lsp_test.go
+++ b/gopls/internal/lsp/lsp_test.go
@@ -23,9 +23,9 @@
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/tests"
"golang.org/x/tools/gopls/internal/lsp/tests/compare"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/testenv"
)
diff --git a/gopls/internal/lsp/mod/mod_test.go b/gopls/internal/lsp/mod/mod_test.go
index 75c1666..767ec44 100644
--- a/gopls/internal/lsp/mod/mod_test.go
+++ b/gopls/internal/lsp/mod/mod_test.go
@@ -13,7 +13,7 @@
"golang.org/x/tools/gopls/internal/lsp/cache"
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/tests"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/testenv"
)
diff --git a/gopls/internal/lsp/protocol/span.go b/gopls/internal/lsp/protocol/span.go
index cbf57a9..bfa2f81 100644
--- a/gopls/internal/lsp/protocol/span.go
+++ b/gopls/internal/lsp/protocol/span.go
@@ -12,7 +12,7 @@
"go/token"
"unicode/utf8"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// A ColumnMapper maps between UTF-8 oriented positions (e.g. token.Pos,
diff --git a/gopls/internal/lsp/rename.go b/gopls/internal/lsp/rename.go
index 2d9ad69..e9bb2d4 100644
--- a/gopls/internal/lsp/rename.go
+++ b/gopls/internal/lsp/rename.go
@@ -10,7 +10,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (s *Server) rename(ctx context.Context, params *protocol.RenameParams) (*protocol.WorkspaceEdit, error) {
diff --git a/gopls/internal/lsp/server.go b/gopls/internal/lsp/server.go
index 0d257b2..693afae 100644
--- a/gopls/internal/lsp/server.go
+++ b/gopls/internal/lsp/server.go
@@ -14,8 +14,8 @@
"golang.org/x/tools/gopls/internal/lsp/progress"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/jsonrpc2"
- "golang.org/x/tools/internal/span"
)
const concurrentAnalyses = 1
diff --git a/gopls/internal/lsp/source/call_hierarchy.go b/gopls/internal/lsp/source/call_hierarchy.go
index 298c712..1097d62 100644
--- a/gopls/internal/lsp/source/call_hierarchy.go
+++ b/gopls/internal/lsp/source/call_hierarchy.go
@@ -14,10 +14,10 @@
"path/filepath"
"golang.org/x/tools/go/ast/astutil"
+ "golang.org/x/tools/gopls/internal/lsp/protocol"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
- "golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
)
// PrepareCallHierarchy returns an array of CallHierarchyItem for a file and the position within the file.
diff --git a/gopls/internal/lsp/source/code_lens.go b/gopls/internal/lsp/source/code_lens.go
index 6f1d720..83ffcc2 100644
--- a/gopls/internal/lsp/source/code_lens.go
+++ b/gopls/internal/lsp/source/code_lens.go
@@ -15,7 +15,7 @@
"golang.org/x/tools/gopls/internal/lsp/command"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
type LensFunc func(context.Context, Snapshot, FileHandle) ([]protocol.CodeLens, error)
diff --git a/gopls/internal/lsp/source/completion/completion.go b/gopls/internal/lsp/source/completion/completion.go
index 2ffd9bf..1e5dd1c 100644
--- a/gopls/internal/lsp/source/completion/completion.go
+++ b/gopls/internal/lsp/source/completion/completion.go
@@ -23,13 +23,13 @@
"unicode"
"golang.org/x/tools/go/ast/astutil"
- "golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/imports"
- "golang.org/x/tools/internal/fuzzy"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/snippet"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/event"
+ "golang.org/x/tools/internal/fuzzy"
+ "golang.org/x/tools/internal/imports"
"golang.org/x/tools/internal/typeparams"
)
diff --git a/gopls/internal/lsp/source/completion/definition.go b/gopls/internal/lsp/source/completion/definition.go
index e61a9fa..fe41c55 100644
--- a/gopls/internal/lsp/source/completion/definition.go
+++ b/gopls/internal/lsp/source/completion/definition.go
@@ -15,7 +15,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/snippet"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// some definitions can be completed
diff --git a/gopls/internal/lsp/source/completion/format.go b/gopls/internal/lsp/source/completion/format.go
index 4a76eef..c2693dc 100644
--- a/gopls/internal/lsp/source/completion/format.go
+++ b/gopls/internal/lsp/source/completion/format.go
@@ -16,10 +16,10 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/snippet"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
"golang.org/x/tools/internal/imports"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/typeparams"
)
diff --git a/gopls/internal/lsp/source/completion/package.go b/gopls/internal/lsp/source/completion/package.go
index 1f3649b..b7fad0f 100644
--- a/gopls/internal/lsp/source/completion/package.go
+++ b/gopls/internal/lsp/source/completion/package.go
@@ -18,12 +18,12 @@
"strings"
"unicode"
- "golang.org/x/tools/internal/bug"
- "golang.org/x/tools/internal/fuzzy"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/safetoken"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/bug"
+ "golang.org/x/tools/internal/fuzzy"
)
// packageClauseCompletions offers completions for a package declaration when
diff --git a/gopls/internal/lsp/source/diagnostics.go b/gopls/internal/lsp/source/diagnostics.go
index faf4919..c292f25 100644
--- a/gopls/internal/lsp/source/diagnostics.go
+++ b/gopls/internal/lsp/source/diagnostics.go
@@ -8,7 +8,7 @@
"context"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
type SuggestedFix struct {
diff --git a/gopls/internal/lsp/source/extract.go b/gopls/internal/lsp/source/extract.go
index 8e6f77d..488305a 100644
--- a/gopls/internal/lsp/source/extract.go
+++ b/gopls/internal/lsp/source/extract.go
@@ -19,9 +19,9 @@
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/gopls/internal/lsp/safetoken"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/analysisinternal"
"golang.org/x/tools/internal/bug"
- "golang.org/x/tools/internal/span"
)
func extractVariable(fset *token.FileSet, rng span.Range, src []byte, file *ast.File, _ *types.Package, info *types.Info) (*analysis.SuggestedFix, error) {
diff --git a/gopls/internal/lsp/source/fix.go b/gopls/internal/lsp/source/fix.go
index bce2536..1ce6d75 100644
--- a/gopls/internal/lsp/source/fix.go
+++ b/gopls/internal/lsp/source/fix.go
@@ -14,9 +14,9 @@
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/gopls/internal/lsp/analysis/fillstruct"
"golang.org/x/tools/gopls/internal/lsp/analysis/undeclaredname"
- "golang.org/x/tools/internal/bug"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/bug"
)
type (
diff --git a/gopls/internal/lsp/source/gc_annotations.go b/gopls/internal/lsp/source/gc_annotations.go
index 111cd4f..ab0fd60 100644
--- a/gopls/internal/lsp/source/gc_annotations.go
+++ b/gopls/internal/lsp/source/gc_annotations.go
@@ -14,9 +14,9 @@
"path/filepath"
"strings"
- "golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/gocommand"
)
type Annotation string
diff --git a/gopls/internal/lsp/source/identifier.go b/gopls/internal/lsp/source/identifier.go
index 91c7b6b..7bf1e12 100644
--- a/gopls/internal/lsp/source/identifier.go
+++ b/gopls/internal/lsp/source/identifier.go
@@ -17,9 +17,9 @@
"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/safetoken"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/typeparams"
)
diff --git a/gopls/internal/lsp/source/implementation.go b/gopls/internal/lsp/source/implementation.go
index 3533c92..e2c60bb 100644
--- a/gopls/internal/lsp/source/implementation.go
+++ b/gopls/internal/lsp/source/implementation.go
@@ -15,8 +15,8 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/safetoken"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/span"
)
func Implementation(ctx context.Context, snapshot Snapshot, f FileHandle, pp protocol.Position) ([]protocol.Location, error) {
diff --git a/gopls/internal/lsp/source/references.go b/gopls/internal/lsp/source/references.go
index 714a3cb..9a10b38 100644
--- a/gopls/internal/lsp/source/references.go
+++ b/gopls/internal/lsp/source/references.go
@@ -16,9 +16,9 @@
"strconv"
"golang.org/x/tools/gopls/internal/lsp/protocol"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/span"
)
// ReferenceInfo holds information about reference to an identifier in Go source.
diff --git a/gopls/internal/lsp/source/rename.go b/gopls/internal/lsp/source/rename.go
index c5af1ca..495791f 100644
--- a/gopls/internal/lsp/source/rename.go
+++ b/gopls/internal/lsp/source/rename.go
@@ -20,9 +20,9 @@
"golang.org/x/tools/go/types/typeutil"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/safetoken"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/diff"
"golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/refactor/satisfy"
)
diff --git a/gopls/internal/lsp/source/source_test.go b/gopls/internal/lsp/source/source_test.go
index d81bdb7..8c49306 100644
--- a/gopls/internal/lsp/source/source_test.go
+++ b/gopls/internal/lsp/source/source_test.go
@@ -21,9 +21,9 @@
"golang.org/x/tools/gopls/internal/lsp/source/completion"
"golang.org/x/tools/gopls/internal/lsp/tests"
"golang.org/x/tools/gopls/internal/lsp/tests/compare"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/fuzzy"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/testenv"
)
diff --git a/gopls/internal/lsp/source/stub.go b/gopls/internal/lsp/source/stub.go
index 3aab0b4..2d00ea5 100644
--- a/gopls/internal/lsp/source/stub.go
+++ b/gopls/internal/lsp/source/stub.go
@@ -20,7 +20,7 @@
"golang.org/x/tools/gopls/internal/lsp/analysis/stubmethods"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/safetoken"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/typeparams"
)
diff --git a/gopls/internal/lsp/source/util.go b/gopls/internal/lsp/source/util.go
index 9939ca0..b06992e 100644
--- a/gopls/internal/lsp/source/util.go
+++ b/gopls/internal/lsp/source/util.go
@@ -19,8 +19,8 @@
"golang.org/x/mod/modfile"
"golang.org/x/tools/gopls/internal/lsp/protocol"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/bug"
- "golang.org/x/tools/internal/span"
"golang.org/x/tools/internal/typeparams"
)
diff --git a/gopls/internal/lsp/source/util_test.go b/gopls/internal/lsp/source/util_test.go
index e0b2a29..60128e2 100644
--- a/gopls/internal/lsp/source/util_test.go
+++ b/gopls/internal/lsp/source/util_test.go
@@ -11,7 +11,7 @@
"testing"
"golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func TestMappedRangeAdjustment(t *testing.T) {
diff --git a/gopls/internal/lsp/source/view.go b/gopls/internal/lsp/source/view.go
index fa9d6a9..e679839 100644
--- a/gopls/internal/lsp/source/view.go
+++ b/gopls/internal/lsp/source/view.go
@@ -23,9 +23,9 @@
"golang.org/x/tools/go/packages"
"golang.org/x/tools/gopls/internal/lsp/command"
"golang.org/x/tools/gopls/internal/lsp/protocol"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/internal/imports"
- "golang.org/x/tools/internal/span"
)
// Snapshot represents the current state for the given view.
diff --git a/gopls/internal/lsp/source/workspace_symbol.go b/gopls/internal/lsp/source/workspace_symbol.go
index 8fe2388..dabbeb3 100644
--- a/gopls/internal/lsp/source/workspace_symbol.go
+++ b/gopls/internal/lsp/source/workspace_symbol.go
@@ -16,10 +16,10 @@
"strings"
"unicode"
+ "golang.org/x/tools/gopls/internal/lsp/protocol"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/fuzzy"
- "golang.org/x/tools/gopls/internal/lsp/protocol"
- "golang.org/x/tools/internal/span"
)
// Symbol holds a precomputed symbol value. Note: we avoid using the
diff --git a/gopls/internal/lsp/template/implementations.go b/gopls/internal/lsp/template/implementations.go
index 3d14f6b..6c90b68 100644
--- a/gopls/internal/lsp/template/implementations.go
+++ b/gopls/internal/lsp/template/implementations.go
@@ -13,7 +13,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// line number (1-based) and message
diff --git a/gopls/internal/lsp/template/parse.go b/gopls/internal/lsp/template/parse.go
index 679bd4d..06b7568 100644
--- a/gopls/internal/lsp/template/parse.go
+++ b/gopls/internal/lsp/template/parse.go
@@ -26,8 +26,8 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/span"
)
var (
diff --git a/gopls/internal/lsp/tests/tests.go b/gopls/internal/lsp/tests/tests.go
index 2b8e830..cab96e0 100644
--- a/gopls/internal/lsp/tests/tests.go
+++ b/gopls/internal/lsp/tests/tests.go
@@ -32,7 +32,7 @@
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/source/completion"
"golang.org/x/tools/gopls/internal/lsp/tests/compare"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/testenv"
"golang.org/x/tools/internal/typeparams"
"golang.org/x/tools/txtar"
diff --git a/gopls/internal/lsp/tests/util.go b/gopls/internal/lsp/tests/util.go
index ce5ab5b..2951f03 100644
--- a/gopls/internal/lsp/tests/util.go
+++ b/gopls/internal/lsp/tests/util.go
@@ -20,8 +20,8 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/source/completion"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/diff"
- "golang.org/x/tools/internal/span"
)
// DiffLinks takes the links we got and checks if they are located within the source or a Note.
diff --git a/gopls/internal/lsp/text_synchronization.go b/gopls/internal/lsp/text_synchronization.go
index c360e1e..9687528 100644
--- a/gopls/internal/lsp/text_synchronization.go
+++ b/gopls/internal/lsp/text_synchronization.go
@@ -12,11 +12,11 @@
"path/filepath"
"time"
- "golang.org/x/tools/internal/event"
- "golang.org/x/tools/internal/jsonrpc2"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
+ "golang.org/x/tools/internal/event"
+ "golang.org/x/tools/internal/jsonrpc2"
"golang.org/x/tools/internal/xcontext"
)
diff --git a/gopls/internal/lsp/work/diagnostics.go b/gopls/internal/lsp/work/diagnostics.go
index 72c06e0..5d3a328 100644
--- a/gopls/internal/lsp/work/diagnostics.go
+++ b/gopls/internal/lsp/work/diagnostics.go
@@ -13,9 +13,9 @@
"golang.org/x/mod/modfile"
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/event/tag"
- "golang.org/x/tools/internal/span"
)
func Diagnostics(ctx context.Context, snapshot source.Snapshot) (map[source.VersionedFileIdentity][]*source.Diagnostic, error) {
diff --git a/gopls/internal/lsp/workspace.go b/gopls/internal/lsp/workspace.go
index 79f144b..0e780d2 100644
--- a/gopls/internal/lsp/workspace.go
+++ b/gopls/internal/lsp/workspace.go
@@ -10,7 +10,7 @@
"golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
func (s *Server) didChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error {
diff --git a/internal/span/parse.go b/gopls/internal/span/parse.go
similarity index 100%
rename from internal/span/parse.go
rename to gopls/internal/span/parse.go
diff --git a/internal/span/span.go b/gopls/internal/span/span.go
similarity index 100%
rename from internal/span/span.go
rename to gopls/internal/span/span.go
diff --git a/internal/span/span_test.go b/gopls/internal/span/span_test.go
similarity index 97%
rename from internal/span/span_test.go
rename to gopls/internal/span/span_test.go
index cff59c3..63c0752 100644
--- a/internal/span/span_test.go
+++ b/gopls/internal/span/span_test.go
@@ -11,7 +11,7 @@
"strings"
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
var (
diff --git a/internal/span/token.go b/gopls/internal/span/token.go
similarity index 100%
rename from internal/span/token.go
rename to gopls/internal/span/token.go
diff --git a/internal/span/token_test.go b/gopls/internal/span/token_test.go
similarity index 97%
rename from internal/span/token_test.go
rename to gopls/internal/span/token_test.go
index 1e0b53e..997c8fb 100644
--- a/internal/span/token_test.go
+++ b/gopls/internal/span/token_test.go
@@ -10,7 +10,7 @@
"path"
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
var testdata = []struct {
diff --git a/internal/span/uri.go b/gopls/internal/span/uri.go
similarity index 100%
rename from internal/span/uri.go
rename to gopls/internal/span/uri.go
diff --git a/internal/span/uri_test.go b/gopls/internal/span/uri_test.go
similarity index 98%
rename from internal/span/uri_test.go
rename to gopls/internal/span/uri_test.go
index bcbad87..e990437 100644
--- a/internal/span/uri_test.go
+++ b/gopls/internal/span/uri_test.go
@@ -10,7 +10,7 @@
import (
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// TestURI tests the conversion between URIs and filenames. The test cases
diff --git a/internal/span/uri_windows_test.go b/gopls/internal/span/uri_windows_test.go
similarity index 98%
rename from internal/span/uri_windows_test.go
rename to gopls/internal/span/uri_windows_test.go
index e50b58f..3891e0d 100644
--- a/internal/span/uri_windows_test.go
+++ b/gopls/internal/span/uri_windows_test.go
@@ -10,7 +10,7 @@
import (
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// TestURI tests the conversion between URIs and filenames. The test cases
diff --git a/internal/span/utf16.go b/gopls/internal/span/utf16.go
similarity index 100%
rename from internal/span/utf16.go
rename to gopls/internal/span/utf16.go
diff --git a/internal/span/utf16_test.go b/gopls/internal/span/utf16_test.go
similarity index 99%
rename from internal/span/utf16_test.go
rename to gopls/internal/span/utf16_test.go
index 1eae797..5f75095 100644
--- a/internal/span/utf16_test.go
+++ b/gopls/internal/span/utf16_test.go
@@ -8,7 +8,7 @@
"strings"
"testing"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
// The funny character below is 4 bytes long in UTF-8; two UTF-16 code points
diff --git a/gopls/internal/vulncheck/vulntest/db.go b/gopls/internal/vulncheck/vulntest/db.go
index 674e920..511a47e 100644
--- a/gopls/internal/vulncheck/vulntest/db.go
+++ b/gopls/internal/vulncheck/vulntest/db.go
@@ -20,7 +20,7 @@
"strings"
"time"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
"golang.org/x/tools/txtar"
"golang.org/x/vuln/client"
"golang.org/x/vuln/osv"
diff --git a/gopls/test/debug/debug_test.go b/gopls/test/debug/debug_test.go
index 9c6c0d6..9d5d6f0 100644
--- a/gopls/test/debug/debug_test.go
+++ b/gopls/test/debug/debug_test.go
@@ -24,7 +24,7 @@
"golang.org/x/tools/gopls/internal/lsp/cache"
"golang.org/x/tools/gopls/internal/lsp/debug"
"golang.org/x/tools/gopls/internal/lsp/source"
- "golang.org/x/tools/internal/span"
+ "golang.org/x/tools/gopls/internal/span"
)
type tdata struct {
diff --git a/internal/diff/diff_test.go b/internal/diff/diff_test.go
index 3475407..e23cb1d 100644
--- a/internal/diff/diff_test.go
+++ b/internal/diff/diff_test.go
@@ -120,9 +120,9 @@
}
func TestRegressionOld001(t *testing.T) {
- a := "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage diff_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/tools/gopls/internal/lsp/diff\"\n\t\"golang.org/x/tools/internal/diff/difftest\"\n\t\"golang.org/x/tools/internal/span\"\n)\n"
+ a := "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage diff_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/tools/gopls/internal/lsp/diff\"\n\t\"golang.org/x/tools/internal/diff/difftest\"\n\t\"golang.org/x/tools/gopls/internal/span\"\n)\n"
- b := "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage diff_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/safehtml/template\"\n\t\"golang.org/x/tools/gopls/internal/lsp/diff\"\n\t\"golang.org/x/tools/internal/diff/difftest\"\n\t\"golang.org/x/tools/internal/span\"\n)\n"
+ b := "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage diff_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/safehtml/template\"\n\t\"golang.org/x/tools/gopls/internal/lsp/diff\"\n\t\"golang.org/x/tools/internal/diff/difftest\"\n\t\"golang.org/x/tools/gopls/internal/span\"\n)\n"
diffs := diff.Strings(a, b)
got, err := diff.Apply(a, diffs)
if err != nil {
diff --git a/internal/diff/lcs/old_test.go b/internal/diff/lcs/old_test.go
index 828a9d9..1d60476 100644
--- a/internal/diff/lcs/old_test.go
+++ b/internal/diff/lcs/old_test.go
@@ -97,9 +97,9 @@
}
func TestRegressionOld001(t *testing.T) {
- a := "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage diff_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/tools/gopls/internal/lsp/diff\"\n\t\"golang.org/x/tools/internal/diff/difftest\"\n\t\"golang.org/x/tools/internal/span\"\n)\n"
+ a := "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage diff_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/tools/gopls/internal/lsp/diff\"\n\t\"golang.org/x/tools/internal/diff/difftest\"\n\t\"golang.org/x/tools/gopls/internal/span\"\n)\n"
- b := "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage diff_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/safehtml/template\"\n\t\"golang.org/x/tools/gopls/internal/lsp/diff\"\n\t\"golang.org/x/tools/internal/diff/difftest\"\n\t\"golang.org/x/tools/internal/span\"\n)\n"
+ b := "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage diff_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/safehtml/template\"\n\t\"golang.org/x/tools/gopls/internal/lsp/diff\"\n\t\"golang.org/x/tools/internal/diff/difftest\"\n\t\"golang.org/x/tools/gopls/internal/span\"\n)\n"
for i := 1; i < len(b); i++ {
diffs, lcs := Compute([]byte(a), []byte(b), int(i)) // 14 from gopls
if !lcs.valid() {