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