summaryrefslogtreecommitdiff
path: root/src/dged/syntax.c
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2024-09-17 08:47:03 +0200
committerAlbert Cervin <albert@acervin.com>2025-11-01 22:11:14 +0100
commit4459b8b3aa9d73895391785a99dcc87134e80601 (patch)
treea5204f447a0b2b05f63504c7fe958ef9bbf1918a /src/dged/syntax.c
parent4689f3f38277bb64981fc960e8e384e2d065d659 (diff)
downloaddged-4459b8b3aa9d73895391785a99dcc87134e80601.tar.gz
dged-4459b8b3aa9d73895391785a99dcc87134e80601.tar.xz
dged-4459b8b3aa9d73895391785a99dcc87134e80601.zip
More lsp support
This makes the LSP support complete for now: - Completion - Diagnostics - Goto implementation/declaration - Rename - Documentation - Find references
Diffstat (limited to 'src/dged/syntax.c')
-rw-r--r--src/dged/syntax.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dged/syntax.c b/src/dged/syntax.c
index 5d9aeaa..0ffa8d4 100644
--- a/src/dged/syntax.c
+++ b/src/dged/syntax.c
@@ -2,7 +2,6 @@
#include <ctype.h>
#include <dlfcn.h>
-#include <errno.h>
#include <fcntl.h>
#include <regex.h>
#include <string.h>
@@ -14,7 +13,6 @@
#include "buffer.h"
#include "display.h"
-#include "hash.h"
#include "minibuffer.h"
#include "path.h"
#include "s8.h"
@@ -33,6 +31,7 @@ struct predicate {
bool (*eval)(struct s8, uint32_t, struct s8[], struct s8, void *);
uint32_t argc;
+
struct s8 argv[32];
void *data;
@@ -332,9 +331,8 @@ static bool eval_predicates(struct highlight *h, struct text *text,
#define match_cname(cname, capture) \
(s8eq(cname, s8(capture)) || s8startswith(cname, s8(capture ".")))
-static void update_parser(struct buffer *buffer, void *userdata,
- struct location origin, uint32_t width,
- uint32_t height) {
+static void update_parser(struct buffer *buffer, struct location origin,
+ uint32_t width, uint32_t height, void *userdata) {
(void)width;
@@ -406,7 +404,8 @@ static void update_parser(struct buffer *buffer, void *userdata,
highlight = false;
} else if (match_cname(cname, "label")) {
highlight = false;
- } else if (match_cname(cname, "type")) {
+ } else if (match_cname(cname, "type") ||
+ match_cname(cname, "constructor")) {
highlight = true;
color = Color_Cyan;
} else if (match_cname(cname, "variable")) {