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
@@ -14,7 +14,7 @@ import (
// break callers silently. Enumerate the columns you need explicitly.
type ruleCOR001 struct{}
func (ruleCOR001) ID() string { return "COR001" }
func (ruleCOR001) ID() string { return "COR001" }
func (ruleCOR001) Severity() diagnostics.Severity { return diagnostics.SeverityHint }
func (ruleCOR001) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {
@@ -71,7 +71,7 @@ func checkSelectStmt(s *pg_query.SelectStmt, src string, out *[]diagnostics.Diag
// An UPDATE with no WHERE clause modifies every row in the table.
type ruleCOR002 struct{}
func (ruleCOR002) ID() string { return "COR002" }
func (ruleCOR002) ID() string { return "COR002" }
func (ruleCOR002) Severity() diagnostics.Severity { return diagnostics.SeverityWarning }
func (ruleCOR002) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {
@@ -101,7 +101,7 @@ func (ruleCOR002) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Dia
// Use TRUNCATE if you intend a full wipe; it is faster and explicit.
type ruleCOR003 struct{}
func (ruleCOR003) ID() string { return "COR003" }
func (ruleCOR003) ID() string { return "COR003" }
func (ruleCOR003) Severity() diagnostics.Severity { return diagnostics.SeverityWarning }
func (ruleCOR003) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {