1
0
mirror of https://github.com/golang/go synced 2024-10-01 11:18:32 -06:00
go/internal/lsp/testdata/imports/add_import.go.in
Heschi Kreinick 8ceaad4c15 internal/lsp/source: don't format the whole file when adding imports
We want people to add imports as they need them. That means we probably
don't want adding an import to reformat your whole file while you're in
the middle of editing it.

Unfortunately, the AST package doesn't offer any help with this --
there's no good way to get a diff out of it. Instead, we apply the
changes, then diff a subset of the file. Picking that subset is tricky,
see the code for details.

Also delete a dead function, Imports, which should have been unused but
was still being called in tests.

Fixes golang/go#30843.

Change-Id: I09a5344e910f65510003c4006ea5b11657922315
Reviewed-on: https://go-review.googlesource.com/c/tools/+/205678
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-11-07 22:26:10 +00:00

11 lines
109 B
Go

package imports //@import("package")
import (
"fmt"
)
func _() {
fmt.Println("")
bytes.NewBuffer(nil)
}