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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user