summaryrefslogtreecommitdiff
path: root/ide-autocomplete.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-04 20:15:45 -0500
committerpommicket <pommicket@gmail.com>2023-01-04 20:15:55 -0500
commit808b9a13cb5c71c28db6c842b78ef7f1743283cd (patch)
tree1f57a266294c9fc99673981403361c2d5507d1ba /ide-autocomplete.c
parentd9cc57e9ff1725e6e63973705adbf218d6961d17 (diff)
the great "filename to path" rename
Diffstat (limited to 'ide-autocomplete.c')
-rw-r--r--ide-autocomplete.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ide-autocomplete.c b/ide-autocomplete.c
index 39ee076..9f70758 100644
--- a/ide-autocomplete.c
+++ b/ide-autocomplete.c
@@ -112,6 +112,9 @@ static void autocomplete_no_suggestions(Ted *ted) {
}
static void autocomplete_send_completion_request(Ted *ted, TextBuffer *buffer, BufferPos pos, uint32_t trigger) {
+ if (!buffer->path)
+ return; // no can do
+
LSP *lsp = buffer_lsp(buffer);
Autocomplete *ac = &ted->autocomplete;
@@ -129,7 +132,7 @@ static void autocomplete_send_completion_request(Ted *ted, TextBuffer *buffer, B
request.data.completion = (LSPRequestCompletion) {
.position = {
- .document = lsp_document_id(lsp, buffer->filename),
+ .document = lsp_document_id(lsp, buffer->path),
.pos = buffer_pos_to_lsp_position(buffer, pos)
},
.context = {
@@ -295,7 +298,7 @@ void autocomplete_open(Ted *ted, uint32_t trigger) {
if (ac->open) return;
if (!ted->active_buffer) return;
TextBuffer *buffer = ted->active_buffer;
- if (!buffer->filename) return;
+ if (!buffer->path) return;
if (buffer->view_only) return;
ted->cursor_error_time = 0;