go/internal/lsp/analysis/fillstruct
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 internal: fill struct with initialized values instead of nil values 2020-06-23 18:51:56 +00:00
fillstruct.go internal/lsp/analysis/fillstruct: add indentation for struct fields 2020-06-23 20:47:33 +00:00
fillstruct_test.go internal/lsp: port fill struct into analysis framework 2020-06-12 20:33:59 +00:00