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:
@@ -22,7 +22,7 @@ func isSnakeCase(s string) bool {
|
||||
// NAM001 — table names must be snake_case.
|
||||
type ruleNAM001 struct{}
|
||||
|
||||
func (ruleNAM001) ID() string { return "NAM001" }
|
||||
func (ruleNAM001) ID() string { return "NAM001" }
|
||||
func (ruleNAM001) Severity() diagnostics.Severity { return diagnostics.SeverityHint }
|
||||
|
||||
func (ruleNAM001) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {
|
||||
@@ -51,7 +51,7 @@ func (ruleNAM001) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Dia
|
||||
// NAM002 — column names in CREATE TABLE must be snake_case.
|
||||
type ruleNAM002 struct{}
|
||||
|
||||
func (ruleNAM002) ID() string { return "NAM002" }
|
||||
func (ruleNAM002) ID() string { return "NAM002" }
|
||||
func (ruleNAM002) Severity() diagnostics.Severity { return diagnostics.SeverityHint }
|
||||
|
||||
func (ruleNAM002) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {
|
||||
@@ -86,7 +86,7 @@ func (ruleNAM002) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Dia
|
||||
// NAM003 — function/procedure names must be snake_case.
|
||||
type ruleNAM003 struct{}
|
||||
|
||||
func (ruleNAM003) ID() string { return "NAM003" }
|
||||
func (ruleNAM003) ID() string { return "NAM003" }
|
||||
func (ruleNAM003) Severity() diagnostics.Severity { return diagnostics.SeverityHint }
|
||||
|
||||
func (ruleNAM003) Check(stmts []*pg_query.RawStmt, src string) []diagnostics.Diagnostic {
|
||||
|
||||
Reference in New Issue
Block a user