1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:44:42 -07:00
go/internal/lsp/analysis/undeclaredname
Rebecca Stambler f8e0ea3a3a internal/lsp/analysis/fillstruct: add indentation for struct fields
Getting the right indentation for the text in the AST proves to be a
little complicated. The most reasonable approach seems to be writing
out the AST, getting the lines with the struct definition on it,
and trimming whitespace to get the current indent. Then, we add this
indent to the struct fields in the new text.

Change-Id: I1cc3421d95edae61cfb662254ff3fb759b5c487f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/239199
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-06-23 20:47:33 +00:00
..
testdata/src/a internal/lsp/analysis: add quickfix for undeclared variable 2020-03-27 18:31:06 +00:00
undeclared_test.go internal/lsp/analysis: add quickfix for undeclared variable 2020-03-27 18:31:06 +00:00
undeclared.go internal/lsp/analysis/fillstruct: add indentation for struct fields 2020-06-23 20:47:33 +00:00