From f7b6a898a46f76ee87102157912eb3034c32adaa Mon Sep 17 00:00:00 2001 From: Ian Cottrell Date: Wed, 20 Feb 2019 12:20:02 -0500 Subject: [PATCH] internal/lsp: remove unused range parameter from computeTextEdits Change-Id: I3e9853b2a83d0328d10bcb75fc9f1f1cc996f14e Reviewed-on: https://go-review.googlesource.com/c/163157 Run-TryBot: Ian Cottrell TryBot-Result: Gobot Gobot Reviewed-by: Rebecca Stambler --- internal/lsp/source/format.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/lsp/source/format.go b/internal/lsp/source/format.go index 3c4ae69c..1a7e8b08 100644 --- a/internal/lsp/source/format.go +++ b/internal/lsp/source/format.go @@ -52,7 +52,7 @@ func Format(ctx context.Context, f File, rng Range) ([]TextEdit, error) { if err := format.Node(buf, fset, node); err != nil { return nil, err } - return computeTextEdits(rng, f, buf.String()), nil + return computeTextEdits(f, buf.String()), nil } // Imports formats a file using the goimports tool. @@ -61,10 +61,10 @@ func Imports(ctx context.Context, f File, rng Range) ([]TextEdit, error) { if err != nil { return nil, err } - return computeTextEdits(rng, f, string(formatted)), nil + return computeTextEdits(f, string(formatted)), nil } -func computeTextEdits(rng Range, file File, formatted string) (edits []TextEdit) { +func computeTextEdits(file File, formatted string) (edits []TextEdit) { u := strings.SplitAfter(string(file.GetContent()), "\n") tok := file.GetToken() f := strings.SplitAfter(formatted, "\n")