diff options
author | pommicket <pommicket@gmail.com> | 2022-12-29 12:12:36 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-29 12:12:36 -0500 |
commit | 18fbb21e6b95139a8890ba4a65f4402df128ac84 (patch) | |
tree | e72f8f462465d14bf48a88372f90d2d347f025c9 /base.h | |
parent | 948decc409bac1e3671afc5d0212b4b35c669b4a (diff) |
working hover
Diffstat (limited to 'base.h')
-rw-r--r-- | base.h | 53 |
1 files changed, 53 insertions, 0 deletions
@@ -175,4 +175,57 @@ static void print(char const *fmt, ...) { #define debug_println(...) #endif +// NOTE: these have to be defined here because lsp.h uses them + +// 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) + + #endif |