feat(lsp): add textDocument/rangeFormatting support
CI / Test (push) Successful in 50s
CI / Build snapshot (push) Failing after 1m12s

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:
2026-06-28 16:28:27 +02:00
parent a98dee1877
commit d1150a7eea
6 changed files with 168 additions and 23 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ import (
// CREATE INDEX CONCURRENTLY instead.
type ruleMIG001 struct{}
func (ruleMIG001) ID() string { return "MIG001" }
func (ruleMIG001) ID() string { return "MIG001" }
func (ruleMIG001) Severity() diagnostics.Severity { return diagnostics.SeverityWarning }
func (ruleMIG001) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {
@@ -52,7 +52,7 @@ func (ruleMIG001) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Dia
// supplied. Use a nullable column first, backfill, then add the constraint.
type ruleMIG002 struct{}
func (ruleMIG002) ID() string { return "MIG002" }
func (ruleMIG002) ID() string { return "MIG002" }
func (ruleMIG002) Severity() diagnostics.Severity { return diagnostics.SeverityWarning }
func (ruleMIG002) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {
@@ -97,7 +97,7 @@ func (ruleMIG002) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Dia
// VALIDATE CONSTRAINT to spread the lock window.
type ruleMIG003 struct{}
func (ruleMIG003) ID() string { return "MIG003" }
func (ruleMIG003) ID() string { return "MIG003" }
func (ruleMIG003) Severity() diagnostics.Severity { return diagnostics.SeverityWarning }
func (ruleMIG003) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {