feat: add LSP server, VSCode + DataGrip extensions, release infra, autofix
- pkg/lsp: JSON-RPC 2.0 LSP server (formatting, diagnostics, codeAction quick-fixes) - cmd/pgtidy: lsp and config subcommands - pkg/diagnostics: TextFix struct for byte-range autofixes - pkg/lint: MIG001/MIG003 autofixes, ApplyFixes helper, --fix flag on lint command - editors/vscode: TypeScript extension with LanguageClient, showVersion/showConfig/formatDocument commands, logo - editors/datagrip: Gradle JetBrains plugin via LSP4IJ, pluginIcon - .goreleaser.yaml, .github/workflows: CI + release pipeline - Makefile: snapshot, release, vscode-compile, vscode-package targets - go.mod + all imports: module path updated to git.warky.dev/wdevs/pgtidy - assets: logo files (256px, 128px, 1024px, ico)
This commit is contained in:
@@ -12,6 +12,15 @@ const (
|
||||
SeverityHint Severity = "hint"
|
||||
)
|
||||
|
||||
// TextFix is a byte-range replacement that can be applied to the source SQL.
|
||||
// Replace src[Offset:End] with New. An insertion has Offset == End.
|
||||
type TextFix struct {
|
||||
Offset int // byte offset in source (inclusive)
|
||||
End int // byte offset in source (exclusive)
|
||||
New string // replacement text
|
||||
Title string // short description shown in editor UI
|
||||
}
|
||||
|
||||
// Diagnostic is a single lint finding.
|
||||
type Diagnostic struct {
|
||||
// RuleID is the stable identifier for the rule that produced this finding
|
||||
@@ -27,4 +36,6 @@ type Diagnostic struct {
|
||||
Line int
|
||||
// Col is the 1-based column number of the finding.
|
||||
Col int
|
||||
// Fix is non-nil when an autofix is available for this diagnostic.
|
||||
Fix *TextFix
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user