summaryrefslogtreecommitdiff
path: root/internal/lsp/types.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-03 16:41:46 +0300
committerPaul Buetow <paul@buetow.org>2025-09-03 16:41:46 +0300
commit3ee19139a95441a3ce10690377de8f453c7aec3f (patch)
treeb627097b2b2863e493e9ef0f9f4a88057c96c228 /internal/lsp/types.go
parentf3a1a41d92651d6d19ee6b078c0ffdc825015bde (diff)
lsp: add 'Hexai: implement unit test' code action for Gov0.4.1
- Generate or append tests to _test.go - Jump to generated test via showDocument (command + server-initiated) - Document the feature in docs/go-unit-tests.md - Prefix action titles with 'Hexai: ' - Bump version to 0.4.1
Diffstat (limited to 'internal/lsp/types.go')
-rw-r--r--internal/lsp/types.go35
1 files changed, 30 insertions, 5 deletions
diff --git a/internal/lsp/types.go b/internal/lsp/types.go
index 5169d44..1598b96 100644
--- a/internal/lsp/types.go
+++ b/internal/lsp/types.go
@@ -124,7 +124,8 @@ type CodeActionParams struct {
}
type WorkspaceEdit struct {
- Changes map[string][]TextEdit `json:"changes,omitempty"`
+ Changes map[string][]TextEdit `json:"changes,omitempty"`
+ DocumentChanges []any `json:"documentChanges,omitempty"`
}
// ApplyWorkspaceEditParams is the client request payload for workspace/applyEdit.
@@ -134,10 +135,34 @@ type ApplyWorkspaceEditParams struct {
}
type CodeAction struct {
- Title string `json:"title"`
- Kind string `json:"kind,omitempty"`
- Edit *WorkspaceEdit `json:"edit,omitempty"`
- Data json.RawMessage `json:"data,omitempty"`
+ Title string `json:"title"`
+ Kind string `json:"kind,omitempty"`
+ Edit *WorkspaceEdit `json:"edit,omitempty"`
+ Data json.RawMessage `json:"data,omitempty"`
+ Command *Command `json:"command,omitempty"`
+}
+
+// Extended workspace edit types (minimal subset)
+type TextDocumentEdit struct {
+ TextDocument VersionedTextDocumentIdentifier `json:"textDocument"`
+ Edits []TextEdit `json:"edits"`
+}
+
+type CreateFile struct {
+ Kind string `json:"kind"`
+ URI string `json:"uri"`
+}
+
+// Commands
+type Command struct {
+ Title string `json:"title"`
+ Command string `json:"command"`
+ Arguments []any `json:"arguments,omitempty"`
+}
+
+type ExecuteCommandParams struct {
+ Command string `json:"command"`
+ Arguments []any `json:"arguments,omitempty"`
}
// Diagnostics (subset needed for code action context)