summaryrefslogtreecommitdiff
path: root/base.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 /base.h
parent948decc409bac1e3671afc5d0212b4b35c669b4a (diff)
working hover
Diffstat (limited to 'base.h')
-rw-r--r--base.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/base.h b/base.h
index 26e874e..bbb1be5 100644
--- a/base.h
+++ b/base.h
@@ -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