feat(lsp): add textDocument/rangeFormatting support
Advertise DocumentRangeFormattingProvider in server capabilities and implement rangeFormat: formats the complete document, then returns an edit covering only the minimal changed-line region that overlaps the client's selection. Also includes gofmt alignment fixes across lint and format packages.
This commit is contained in:
+6
-6
@@ -215,13 +215,13 @@ func formatBodyStatements(text string, st config.Style) string {
|
||||
rawLines := strings.Split(normalised, "\n")
|
||||
|
||||
var (
|
||||
result strings.Builder
|
||||
stmt []bline
|
||||
parenDepth int
|
||||
blockDepth int // 0=col-0 (BEGIN/END/EXCEPTION), 1=body, 2=nested…
|
||||
inException bool
|
||||
result strings.Builder
|
||||
stmt []bline
|
||||
parenDepth int
|
||||
blockDepth int // 0=col-0 (BEGIN/END/EXCEPTION), 1=body, 2=nested…
|
||||
inException bool
|
||||
pendingBlanks int
|
||||
depthInc bool // increment blockDepth after next flush
|
||||
depthInc bool // increment blockDepth after next flush
|
||||
)
|
||||
|
||||
flush := func() {
|
||||
|
||||
Reference in New Issue
Block a user