Add custom syntax highlighter and optimize
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "lsp/lsp.h"
|
||||
#include "pch.h"
|
||||
#include "ts/decl.h"
|
||||
|
||||
static const std::unordered_map<uint8_t, LSP> kLsps = {
|
||||
{1,
|
||||
@@ -168,43 +167,41 @@ static const std::unordered_map<uint8_t, LSP> kLsps = {
|
||||
};
|
||||
|
||||
static const std::unordered_map<std::string, Language> kLanguages = {
|
||||
{"bash", {"bash", LANG(bash), 4, 0x4d5a5e, " "}},
|
||||
{"c", {"c", LANG(cpp), 1, 0x555555, " "}},
|
||||
{"cpp", {"cpp", LANG(cpp), 1, 0x00599C, " "}},
|
||||
{"h", {"h", LANG(cpp), 1, 0xA8B9CC, " "}},
|
||||
{"css", {"css", LANG(css), 5, 0x36a3d9, " "}},
|
||||
{"fish", {"fish", LANG(fish), 7, 0x4d5a5e, " "}},
|
||||
{"go", {"go", LANG(go), 8, 0x00add8, " "}},
|
||||
{"gomod", {"gomod", LANG(gomod), 8, 0x00add8, " "}},
|
||||
{"haskell", {"haskell", LANG(haskell), 9, 0xa074c4, " "}},
|
||||
{"html", {"html", LANG(html), 10, 0xef8a91, " "}},
|
||||
{"javascript", {"javascript", LANG(javascript), 11, 0xf0df8a, " "}},
|
||||
{"typescript", {"typescript", LANG(tsx), 11, 0x36a3d9, " "}},
|
||||
{"json", {"json", LANG(json), 6, 0xcbcb41, "{}"}},
|
||||
{"jsonc", {"jsonc", LANG(json), 6, 0xcbcb41, "{}"}},
|
||||
{"erb", {"erb", LANG(embedded_template), 10, 0x6e1516, " "}},
|
||||
{"ruby", {"ruby", LANG(ruby), 3, 0xff8087, " "}},
|
||||
{"lua", {"lua", LANG(lua), 12, 0x36a3d9, " "}},
|
||||
{"python", {"python", LANG(python), 13, 0x95e6cb, " "}},
|
||||
{"rust", {"rust", LANG(rust), 14, 0xdea584, " "}},
|
||||
{"php", {"php", LANG(php), 15, 0xa074c4, " "}},
|
||||
{"markdown", {"markdown", LANG(markdown), 16, 0x36a3d9, " "}},
|
||||
{"markdown_inline",
|
||||
{"markdown_inline", LANG(markdown_inline), 16, 0x36a3d9, " "}},
|
||||
{"nginx", {"nginx", LANG(nginx), 17, 0x6d8086, " "}},
|
||||
{"toml", {"toml", LANG(toml), 18, 0x36a3d9, " "}},
|
||||
{"yaml", {"yaml", LANG(yaml), 19, 0x6d8086, " "}},
|
||||
{"sql", {"sql", LANG(sql), 20, 0xdad8d8, " "}},
|
||||
{"make", {"make", LANG(make), 21, 0x4e5c61, " "}},
|
||||
{"gdscript", {"gdscript", LANG(gdscript), 0, 0x6d8086, " "}},
|
||||
{"man", {"man", LANG(man), 0, 0xdad8d8, " "}},
|
||||
{"diff", {"diff", LANG(diff), 0, 0xDD4C35, " "}},
|
||||
{"gitattributes",
|
||||
{"gitattributes", LANG(gitattributes), 0, 0xF05032, " "}},
|
||||
{"gitignore", {"gitignore", LANG(gitignore), 0, 0xF05032, " "}},
|
||||
{"query", {"query", LANG(query), 0, 0x7E57C2, " "}},
|
||||
{"regex", {"regex", LANG(regex), 0, 0x9E9E9E, ".*"}},
|
||||
{"ini", {"ini", LANG(ini), 0, 0x6d8086, " "}},
|
||||
{"bash", {"bash", 4, 0x4d5a5e, " "}},
|
||||
{"c", {"c", 1, 0x555555, " "}},
|
||||
{"cpp", {"cpp", 1, 0x00599C, " "}},
|
||||
{"h", {"h", 1, 0xA8B9CC, " "}},
|
||||
{"css", {"css", 5, 0x36a3d9, " "}},
|
||||
{"fish", {"fish", 7, 0x4d5a5e, " "}},
|
||||
{"go", {"go", 8, 0x00add8, " "}},
|
||||
{"gomod", {"gomod", 8, 0x00add8, " "}},
|
||||
{"haskell", {"haskell", 9, 0xa074c4, " "}},
|
||||
{"html", {"html", 10, 0xef8a91, " "}},
|
||||
{"javascript", {"javascript", 11, 0xf0df8a, " "}},
|
||||
{"typescript", {"typescript", 11, 0x36a3d9, " "}},
|
||||
{"json", {"json", 6, 0xcbcb41, "{}"}},
|
||||
{"jsonc", {"jsonc", 6, 0xcbcb41, "{}"}},
|
||||
{"erb", {"erb", 10, 0x6e1516, " "}},
|
||||
{"ruby", {"ruby", 3, 0xff8087, " "}},
|
||||
{"lua", {"lua", 12, 0x36a3d9, " "}},
|
||||
{"python", {"python", 13, 0x95e6cb, " "}},
|
||||
{"rust", {"rust", 14, 0xdea584, " "}},
|
||||
{"php", {"php", 15, 0xa074c4, " "}},
|
||||
{"markdown", {"markdown", 16, 0x36a3d9, " "}},
|
||||
{"markdown_inline", {"markdown_inline", 16, 0x36a3d9, " "}},
|
||||
{"nginx", {"nginx", 17, 0x6d8086, " "}},
|
||||
{"toml", {"toml", 18, 0x36a3d9, " "}},
|
||||
{"yaml", {"yaml", 19, 0x6d8086, " "}},
|
||||
{"sql", {"sql", 20, 0xdad8d8, " "}},
|
||||
{"make", {"make", 21, 0x4e5c61, " "}},
|
||||
{"gdscript", {"gdscript", 0, 0x6d8086, " "}},
|
||||
{"man", {"man", 0, 0xdad8d8, " "}},
|
||||
{"diff", {"diff", 0, 0xDD4C35, " "}},
|
||||
{"gitattributes", {"gitattributes", 0, 0xF05032, " "}},
|
||||
{"gitignore", {"gitignore", 0, 0xF05032, " "}},
|
||||
{"query", {"query", 0, 0x7E57C2, " "}},
|
||||
{"regex", {"regex", 0, 0x9E9E9E, ".*"}},
|
||||
{"ini", {"ini", 0, 0x6d8086, " "}},
|
||||
};
|
||||
|
||||
static const std::unordered_map<std::string, std::string> kExtToLang = {
|
||||
|
||||
Reference in New Issue
Block a user