diff options
Diffstat (limited to 'ted-internal.h')
-rw-r--r-- | ted-internal.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ted-internal.h b/ted-internal.h index a9de122..6875793 100644 --- a/ted-internal.h +++ b/ted-internal.h @@ -260,6 +260,9 @@ typedef struct Definitions Definitions; /// "highlight" information from LSP server typedef struct Highlights Highlights; +/// "code action" information from LSP server +typedef struct CodeAction CodeAction; + typedef struct Macro Macro; typedef struct LoadedFont LoadedFont; @@ -364,6 +367,7 @@ struct Ted { Usages *usages; RenameSymbol *rename_symbol; Formatting *formatting; + CodeAction *code_action; /// process ID int pid; @@ -448,8 +452,25 @@ struct Ted { u64 edit_notify_id; EditNotifyInfo *edit_notifys; +#if HAS_INOTIFY + // 16384 = default inotify queue size + char inotify_event_buf[16384 * sizeof(struct inotify_event)]; +#endif }; +typedef struct { + MessageType severity; + // start position + BufferPos pos; + // end position + BufferPos end; + char *message; + // may be NULL + char *url; + // raw JSON object (for textDocument/codeAction) + char *raw; +} Diagnostic; + // === buffer.c === /// create a new empty buffer with no file name TextBuffer *buffer_new(Ted *ted); @@ -508,6 +529,7 @@ int buffer_inotify_watch(TextBuffer *buffer); /// inform buffer that its watch on the Ted's inotify was modified void buffer_set_inotify_modified(TextBuffer *buffer); #endif +const Diagnostic *buffer_diagnostics(TextBuffer *buffer); // === build.c === void build_frame(Ted *ted, float x1, float y1, float x2, float y2); @@ -634,6 +656,12 @@ void autocomplete_quit(Ted *ted); void autocomplete_frame(Ted *ted); void autocomplete_process_lsp_response(Ted *ted, const LSPResponse *response); +// === ide-code-action.c === +void code_action_init(Ted *ted); +void code_action_quit(Ted *ted); +void code_action_frame(Ted *ted); +bool code_action_process_lsp_response(Ted *ted, const LSPResponse *response); + // === ide-definitions.c === void definitions_init(Ted *ted); /// go to the definition of `name`. @@ -771,5 +799,7 @@ void ted_free_fonts(Ted *ted); void ted_process_publish_diagnostics(Ted *ted, LSP *lsp, LSPRequest *request); /// check inotify fd for events void ted_check_inotify(Ted *ted); +/// perform LSP WorkspaceEdit +void ted_perform_workspace_edit(Ted *ted, LSP *lsp, const LSPResponse *response, const LSPWorkspaceEdit *edit); #endif // TED_INTERNAL_H_ |