First completion level is working (LSP connected)

This commit is contained in:
2026-05-28 18:28:59 +02:00
parent 8eeef59a98
commit a8b2960eb4
27 changed files with 5167 additions and 335 deletions
+35
View File
@@ -0,0 +1,35 @@
//
// Created by Giorgio on 27/05/2026.
//
#ifndef BELUGA_LSP_UI_H
#define BELUGA_LSP_UI_H
#include "data.h"
#include "buffer.h" // for abuf
// ── Public API ────────────────────────────────────────────────────────────────
// Call from editorRefreshScreen() — appends popup/underlines to abuf
void lspUiDrawCompletion(struct abuf *ab, CompletionPopup *popup);
void lspUiDrawDiagnostics(struct abuf *ab, DiagnosticList *diags,
EditorPane *pane, struct buffer_t *buf);
// Input handling — returns 1 if the key was consumed by the popup
int lspUiHandleKey(CompletionPopup *popup, int key);
// Parse clangd JSON into our structs
void lspParseCompletion(const char *json, CompletionPopup *popup,
int screen_x, int screen_y);
void lspParseDiagnostics(const char *json, DiagnosticList *diags, int buffer_id);
void lspUiDrawGutter(struct abuf *ab, DiagnosticList *diags,
int buf_id, int line);
const char *lspUiDiagnosticAtCursor(DiagnosticList *diags,
int buffer_id, int cursor_line);
#endif