diff options
author | pommicket <pommicket@gmail.com> | 2023-01-03 17:29:19 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-03 17:29:19 -0500 |
commit | 87c8bd6eb27edb4bfc539967235c3a1e2f8d77e4 (patch) | |
tree | 4dbcb24ce4fca226e5b70bc5f01d71158d891426 /ted.h | |
parent | 0d92c03f3998fe4d16f3ba928d3a94583755e1ce (diff) |
go to declaration
Diffstat (limited to 'ted.h')
-rw-r--r-- | ted.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -464,6 +464,11 @@ typedef struct { LSPDocumentPosition position; // only set if from_lsp = true } SymbolInfo; +typedef enum { + GOTO_DECLARATION, + GOTO_DEFINITION, +} GotoType; + typedef struct { LSPID last_request_lsp; // used for cancellation // ID of the last request which was sent out. @@ -754,7 +759,7 @@ bool buffer_save(TextBuffer *buffer); bool buffer_save_as(TextBuffer *buffer, const char *new_filename); u32 buffer_first_rendered_line(TextBuffer *buffer); u32 buffer_last_rendered_line(TextBuffer *buffer); -void buffer_goto_word_at_cursor(TextBuffer *buffer); +void buffer_goto_word_at_cursor(TextBuffer *buffer, GotoType type); bool buffer_handle_click(Ted *ted, TextBuffer *buffer, vec2 click, u8 times); void buffer_render(TextBuffer *buffer, Rect r); void buffer_indent_lines(TextBuffer *buffer, u32 first_line, u32 last_line); @@ -951,7 +956,7 @@ void autocomplete_frame(Ted *ted); // if `lsp` is NULL, tags will be used. // Note: the document position is required for LSP requests because of overloading (where the name // alone isn't sufficient) -void definition_goto(Ted *ted, LSP *lsp, const char *name, LSPDocumentPosition pos); +void definition_goto(Ted *ted, LSP *lsp, const char *name, LSPDocumentPosition pos, GotoType type); void definition_cancel_lookup(Ted *ted); void definitions_process_lsp_response(Ted *ted, LSP *lsp, const LSPResponse *response); void definitions_selector_open(Ted *ted); |