Feat: Add syntax highlighting for a lot more languages

This commit is contained in:
2025-12-26 20:46:36 +00:00
parent 9ff3a32abd
commit 655f0e7d77
64 changed files with 9030 additions and 1607 deletions

View File

@@ -37,6 +37,7 @@ static const std::unordered_map<std::string, Language> kLanguages = {
{"make", {"make", LANG(make)}},
{"python", {"python", LANG(python)}},
{"ruby", {"ruby", LANG(ruby)}},
{"rust", {"rust", LANG(rust)}},
{"diff", {"diff", LANG(diff)}},
{"embedded_template", {"embedded_template", LANG(embedded_template)}},
{"gdscript", {"gdscript", LANG(gdscript)}},
@@ -45,6 +46,7 @@ static const std::unordered_map<std::string, Language> kLanguages = {
{"gomod", {"gomod", LANG(gomod)}},
{"ini", {"ini", LANG(ini)}},
{"markdown", {"markdown", LANG(markdown)}},
{"markdown_inline", {"markdown_inline", LANG(markdown_inline)}},
{"nginx", {"nginx", LANG(nginx)}},
{"php", {"php", LANG(php)}},
{"query", {"query", LANG(query)}},
@@ -52,7 +54,6 @@ static const std::unordered_map<std::string, Language> kLanguages = {
{"sql", {"sql", LANG(sql)}},
{"toml", {"toml", LANG(toml)}},
{"yaml", {"yaml", LANG(yaml)}},
{"cabal", {"cabal", LANG(cabal)}},
};
static const std::unordered_map<std::string, std::string> kExtToLang = {
@@ -73,13 +74,17 @@ static const std::unordered_map<std::string, std::string> kExtToLang = {
{"html", "html"},
{"htm", "html"},
{"js", "javascript"},
{"jsx", "javascript"},
{"json", "json"},
{"jsonc", "json"},
{"lua", "lua"},
{"mk", "make"},
{"makefile", "make"},
{"py", "python"},
{"rb", "ruby"},
{"rs", "rust"},
{"diff", "diff"},
{"patch", "diff"},
{"erb", "embedded_template"},
{"etlua", "embedded_template"},
{"gd", "gdscript"},
@@ -87,6 +92,7 @@ static const std::unordered_map<std::string, std::string> kExtToLang = {
{"gitignore", "gitignore"},
{"mod", "gomod"},
{"ini", "ini"},
{"gitmodules", "ini"},
{"md", "markdown"},
{"markdown", "markdown"},
{"conf", "nginx"},
@@ -97,7 +103,6 @@ static const std::unordered_map<std::string, std::string> kExtToLang = {
{"toml", "toml"},
{"yaml", "yaml"},
{"yml", "yaml"},
{"cabal", "cabal"},
};
static const std::unordered_map<std::string, std::string> kMimeToLang = {
@@ -112,6 +117,7 @@ static const std::unordered_map<std::string, std::string> kMimeToLang = {
{"text/x-ruby", "ruby"},
{"text/x-go", "go"},
{"text/x-haskell", "haskell"},
{"text/x-rust", "rust"},
{"text/x-lua", "lua"},
{"text/x-diff", "diff"},
{"text/x-embedded-template", "embedded_template"},
@@ -128,7 +134,6 @@ static const std::unordered_map<std::string, std::string> kMimeToLang = {
{"text/x-sql", "sql"},
{"text/x-toml", "toml"},
{"text/x-yaml", "yaml"},
{"text/x-cabal", "cabal"},
};
#endif

View File

@@ -12,6 +12,7 @@ struct Language {
uint8_t lsp_id = 0;
};
TS_DEF(ruby);
TS_DEF(bash);
TS_DEF(cpp);
TS_DEF(css);
@@ -22,25 +23,24 @@ TS_DEF(html);
TS_DEF(javascript);
TS_DEF(json);
TS_DEF(lua);
TS_DEF(make);
TS_DEF(python);
TS_DEF(ruby);
TS_DEF(rust);
TS_DEF(diff);
TS_DEF(regex);
TS_DEF(query);
TS_DEF(markdown);
TS_DEF(markdown_inline);
TS_DEF(embedded_template);
TS_DEF(gdscript);
TS_DEF(php);
TS_DEF(python);
TS_DEF(rust);
TS_DEF(sql);
TS_DEF(gitattributes);
TS_DEF(gitignore);
TS_DEF(gomod);
TS_DEF(ini);
TS_DEF(markdown);
TS_DEF(nginx);
TS_DEF(php);
TS_DEF(query);
TS_DEF(regex);
TS_DEF(sql);
TS_DEF(toml);
TS_DEF(yaml);
TS_DEF(cabal);
TS_DEF(ini);
TS_DEF(diff);
TS_DEF(make);
TS_DEF(gdscript);
#endif