140 lines
3.9 KiB
C++
140 lines
3.9 KiB
C++
#ifndef MAPS_H
|
|
#define MAPS_H
|
|
|
|
#include "./lsp.h"
|
|
#include "./pch.h"
|
|
#include "./ts_def.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,
|
|
}}},
|
|
};
|
|
|
|
static const std::unordered_map<std::string, Language> kLanguages = {
|
|
{"bash", {"bash", LANG(bash)}},
|
|
{"c", {"c", LANG(cpp), 1}},
|
|
{"cpp", {"cpp", LANG(cpp), 1}},
|
|
{"h", {"h", LANG(cpp), 1}},
|
|
{"css", {"css", LANG(css)}},
|
|
{"fish", {"fish", LANG(fish)}},
|
|
{"go", {"go", LANG(go)}},
|
|
{"haskell", {"haskell", LANG(haskell)}},
|
|
{"html", {"html", LANG(html)}},
|
|
{"javascript", {"javascript", LANG(javascript)}},
|
|
{"json", {"json", LANG(json)}},
|
|
{"lua", {"lua", LANG(lua)}},
|
|
{"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)}},
|
|
{"gitattributes", {"gitattributes", LANG(gitattributes)}},
|
|
{"gitignore", {"gitignore", LANG(gitignore)}},
|
|
{"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)}},
|
|
{"regex", {"regex", LANG(regex)}},
|
|
{"sql", {"sql", LANG(sql)}},
|
|
{"toml", {"toml", LANG(toml)}},
|
|
{"yaml", {"yaml", LANG(yaml)}},
|
|
};
|
|
|
|
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"},
|
|
{"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"},
|
|
{"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"},
|
|
};
|
|
|
|
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-embedded-template", "embedded_template"},
|
|
{"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"},
|
|
};
|
|
|
|
#endif
|