summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-29 12:12:36 -0500
committerpommicket <pommicket@gmail.com>2022-12-29 12:12:36 -0500
commit18fbb21e6b95139a8890ba4a65f4402df128ac84 (patch)
treee72f8f462465d14bf48a88372f90d2d347f025c9 /ted.h
parent948decc409bac1e3671afc5d0212b4b35c669b4a (diff)
working hover
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h58
1 files changed, 6 insertions, 52 deletions
diff --git a/ted.h b/ted.h
index f1748b0..004cc2a 100644
--- a/ted.h
+++ b/ted.h
@@ -63,56 +63,6 @@ enum {
typedef u8 SyntaxState;
-// If you are adding new languages, DO NOT change the constant values
-// of the previous languages. It will mess up config files which use :set-language!
-typedef enum {
- LANG_NONE = 0,
- LANG_C = 1,
- LANG_CPP = 2,
- LANG_RUST = 3,
- LANG_PYTHON = 4,
- LANG_TEX = 5,
- LANG_MARKDOWN = 6,
- LANG_HTML = 7,
- LANG_CONFIG = 8, // .cfg files
- LANG_JAVASCRIPT = 9,
- LANG_JAVA = 10,
- LANG_GO = 11,
- LANG_TED_CFG = 12, // like LANG_CONFIG, but with multiline strings.
- LANG_TYPESCRIPT = 13,
- LANG_JSON = 14,
- LANG_XML = 15,
- LANG_GLSL = 16,
- LANG_COUNT
-} Language;
-
-typedef struct {
- Language lang;
- char const *name;
-} LanguageName;
-
-static LanguageName const language_names[] = {
- {LANG_NONE, "None"},
- {LANG_C, "C"},
- {LANG_CPP, "C++"},
- {LANG_RUST, "Rust"},
- {LANG_PYTHON, "Python"},
- {LANG_TEX, "Tex"},
- {LANG_MARKDOWN, "Markdown"},
- {LANG_HTML, "HTML"},
- {LANG_CONFIG, "Config"},
- {LANG_JAVASCRIPT, "JavaScript"},
- {LANG_JAVA, "Java"},
- {LANG_GO, "Go"},
- {LANG_TED_CFG, "TedCfg"},
- {LANG_TYPESCRIPT, "TypeScript"},
- {LANG_JSON, "JSON"},
- {LANG_XML, "XML"},
- {LANG_GLSL, "GLSL"},
-};
-
-static_assert_if_possible(arr_count(language_names) == LANG_COUNT)
-
ENUM_U8 {
SYNTAX_NORMAL,
SYNTAX_KEYWORD,
@@ -177,6 +127,8 @@ typedef struct {
u32 buffer;
} GlRcSAB;
+
+
typedef struct {
// NOTE: to add more options to ted, add fields here,
// and change the options_<type> global constant in config.c
@@ -450,10 +402,12 @@ typedef struct {
typedef struct {
// is some hover info being displayed?
bool open;
- // amount of time user has been hovering cursor for
- double time;
// text to display
char *text;
+ // where the hover data is coming from.
+ // we use this to check if we need to refresh it.
+ LSPDocumentPosition requested_position;
+ LSPID requested_lsp;
} Hover;