internal/lsp: factor out column mapper construction from content
This eliminates some duplication, and lays the groundwork for removing
the use of token.File within ColumnMapper.
Change-Id: I54fe570bfc4f7bca0da643b8727e890dc6343208
Reviewed-on: https://go-review.googlesource.com/c/tools/+/406135
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/internal/lsp/source/rename.go b/internal/lsp/source/rename.go
index 1cfba80..6312bcb 100644
--- a/internal/lsp/source/rename.go
+++ b/internal/lsp/source/rename.go
@@ -171,12 +171,7 @@
if err != nil {
return nil, err
}
- tf := span.NewTokenFile(uri.Filename(), data)
- m := &protocol.ColumnMapper{
- URI: uri,
- TokFile: tf,
- Content: data,
- }
+ m := protocol.NewColumnMapper(uri, data)
// Sort the edits first.
diff.SortTextEdits(edits)
protocolEdits, err := ToProtocolEdits(m, edits)