Files
crib/include/config.h

292 lines
6.7 KiB
C++

#ifndef CONFIG_H
#define CONFIG_H
#include "lsp/lsp.h"
#include "pch.h"
static const std::unordered_map<uint8_t, LSP> kLsps = {
{1,
{"clangd",
{
"clangd",
"--background-index",
"--clang-tidy",
"--completion-style=detailed",
"--header-insertion=never",
"--pch-storage=memory",
"--limit-results=50",
"--log=error",
nullptr,
}}},
{2,
{"ruby-lsp",
{
"ruby-lsp",
nullptr,
}}},
{3,
{"solargraph",
{
"solargraph",
"stdio",
nullptr,
}}},
{4,
{"bash-language-server",
{
"bash-language-server",
"start",
nullptr,
}}},
{5,
{"vscode-css-language-server",
{
"vscode-css-language-server",
"--stdio",
nullptr,
}}},
{6,
{"vscode-json-language-server",
{
"vscode-json-language-server",
"--stdio",
nullptr,
}}},
{7,
{"fish-lsp",
{
"fish-lsp",
"start",
nullptr,
}}},
{8,
{"gopls",
{
"gopls",
"serve",
nullptr,
}}},
{9,
{"haskell-language-server",
{
"haskell-language-server",
"lsp",
nullptr,
}}},
{10,
{"emmet-language-server",
{
"emmet-language-server",
"--stdio",
nullptr,
}}},
{11,
{"typescript-language-server",
{
"typescript-language-server",
"--stdio",
nullptr,
}}},
#define LUA_LS 12
{12,
{"lua-language-server",
{
"lua-language-server",
nullptr,
}}},
{13,
{"pyright-langserver",
{
"pyright-langserver",
"--stdio",
nullptr,
}}},
{14,
{"rust-analyzer",
{
"rust-analyzer",
nullptr,
}}},
{15,
{"intelephense",
{
"intelephense",
"--stdio",
nullptr,
}}},
{16,
{"marksman",
{
"marksman",
"server",
nullptr,
}}},
{17,
{"nginx-language-server",
{
"nginx-language-server",
nullptr,
}}},
{18,
{"taplo",
{
"taplo",
"lsp",
"stdio",
nullptr,
}}},
{19,
{"yaml-language-server",
{
"yaml-language-server",
"--stdio",
nullptr,
}}},
{20,
{"sqls",
{
"sqls",
"serve",
nullptr,
}}},
{21,
{"make-language-server",
{
"make-language-server",
nullptr,
}}},
{22,
{"sql-language-server",
{
"sql-language-server",
"up",
"--method",
"stdio",
nullptr,
}}},
};
static const std::unordered_map<std::string, Language> kLanguages = {
{"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 = {
{"sh", "bash"},
{"bash", "bash"},
{"c", "c"},
{"cpp", "cpp"},
{"cxx", "cpp"},
{"cc", "cpp"},
{"hpp", "h"},
{"hh", "h"},
{"hxx", "h"},
{"h", "h"},
{"css", "css"},
{"fish", "fish"},
{"go", "go"},
{"hs", "haskell"},
{"html", "html"},
{"htm", "html"},
{"js", "javascript"},
{"jsx", "javascript"},
{"ts", "typescript"},
{"tsx", "typescript"},
{"json", "json"},
{"jsonc", "jsonc"},
{"lua", "lua"},
{"make", "make"},
{"mk", "make"},
{"makefile", "make"},
{"man", "man"},
{"py", "python"},
{"rb", "ruby"},
{"rs", "rust"},
{"diff", "diff"},
{"patch", "diff"},
{"erb", "erb"},
{"gd", "gdscript"},
{"gitattributes", "gitattributes"},
{"gitignore", "gitignore"},
{"mod", "gomod"},
{"ini", "ini"},
{"gitmodules", "ini"},
{"md", "markdown"},
{"markdown", "markdown"},
{"conf", "nginx"},
{"php", "php"},
{"scm", "query"},
{"regex", "regex"},
{"sql", "sql"},
{"toml", "toml"},
{"yaml", "yaml"},
{"yml", "yaml"},
{"clangd", "yaml"},
};
static const std::unordered_map<std::string, std::string> kMimeToLang = {
{"text/x-c", "c"},
{"text/x-c++", "cpp"},
{"text/x-shellscript", "bash"},
{"application/json", "json"},
{"text/javascript", "javascript"},
{"text/html", "html"},
{"text/css", "css"},
{"text/x-python", "python"},
{"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-gdscript", "gdscript"},
{"text/x-gitattributes", "gitattributes"},
{"text/x-gitignore", "gitignore"},
{"text/x-gomod", "gomod"},
{"text/x-ini", "ini"},
{"text/markdown", "markdown"},
{"text/x-nginx-conf", "nginx"},
{"application/x-php", "php"},
{"text/x-tree-sitter-query", "query"},
{"text/x-regex", "regex"},
{"text/x-sql", "sql"},
{"text/x-toml", "toml"},
{"text/x-yaml", "yaml"},
{"text/x-man", "man"},
};
#endif