mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugin/efmls-configs: Map languages to filetypes (#564)
This commit is contained in:
parent
e704db3064
commit
6c656c14d8
2 changed files with 74 additions and 17 deletions
|
@ -11,6 +11,62 @@ tools = {
|
|||
"formatters": {},
|
||||
}
|
||||
|
||||
identity_langs = [
|
||||
"bash",
|
||||
"c",
|
||||
"clojure",
|
||||
"cmake",
|
||||
"crystal",
|
||||
"csh",
|
||||
"css",
|
||||
"d",
|
||||
"dart",
|
||||
"fish",
|
||||
"gitcommit",
|
||||
"go",
|
||||
"haskell",
|
||||
"html",
|
||||
"java",
|
||||
"javascript",
|
||||
"json",
|
||||
"ksh",
|
||||
"less",
|
||||
"lua",
|
||||
"markdown",
|
||||
"nix",
|
||||
"pawn",
|
||||
"php",
|
||||
"python",
|
||||
"roslyn",
|
||||
"ruby",
|
||||
"rust",
|
||||
"sass",
|
||||
"scss",
|
||||
"sh",
|
||||
"slim",
|
||||
"sml",
|
||||
"solidity",
|
||||
"toml",
|
||||
"typescript",
|
||||
"vala",
|
||||
"vim",
|
||||
"yaml",
|
||||
"zsh",
|
||||
"misc",
|
||||
]
|
||||
|
||||
lang_map = {
|
||||
"c#": "cs",
|
||||
"c++": "cpp",
|
||||
"docker": "dockerfile",
|
||||
"objective-c": "objc",
|
||||
"objective-c++": "objcpp",
|
||||
"terraform": "tf",
|
||||
}
|
||||
|
||||
for lang in identity_langs:
|
||||
lang_map[lang] = lang
|
||||
|
||||
for kind in ["linters", "formatters"]:
|
||||
for file in os.listdir(tool_path + "/" + kind):
|
||||
tool_name = file.removesuffix(".lua")
|
||||
|
@ -19,7 +75,8 @@ for kind in ["linters", "formatters"]:
|
|||
for line in f.readlines():
|
||||
if line.startswith("-- languages:"):
|
||||
languages = [
|
||||
l.strip() for l in line.split(":")[1].strip().split(",")
|
||||
lang_map[l.strip()]
|
||||
for l in line.split(":")[1].strip().split(",")
|
||||
]
|
||||
break
|
||||
tools[kind][tool_name] = languages
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
],
|
||||
"astyle": [
|
||||
"c",
|
||||
"c++"
|
||||
"cpp"
|
||||
],
|
||||
"autopep8": [
|
||||
"python"
|
||||
|
@ -25,11 +25,11 @@
|
|||
],
|
||||
"clang_format": [
|
||||
"c",
|
||||
"c++"
|
||||
"cpp"
|
||||
],
|
||||
"clang_tidy": [
|
||||
"c",
|
||||
"c++"
|
||||
"cpp"
|
||||
],
|
||||
"dartfmt": [
|
||||
"dart"
|
||||
|
@ -38,7 +38,7 @@
|
|||
"d"
|
||||
],
|
||||
"dotnet_format": [
|
||||
"c#"
|
||||
"cs"
|
||||
],
|
||||
"dprint": [
|
||||
"javascript",
|
||||
|
@ -153,16 +153,16 @@
|
|||
"lua"
|
||||
],
|
||||
"terraform_fmt": [
|
||||
"terraform"
|
||||
"tf"
|
||||
],
|
||||
"uncrustify": [
|
||||
"c",
|
||||
"c++",
|
||||
"c#",
|
||||
"cpp",
|
||||
"cs",
|
||||
"d",
|
||||
"java",
|
||||
"objective-c",
|
||||
"objective-c++",
|
||||
"objc",
|
||||
"objcpp",
|
||||
"pawn",
|
||||
"vala"
|
||||
],
|
||||
|
@ -192,21 +192,21 @@
|
|||
],
|
||||
"clang_tidy": [
|
||||
"c",
|
||||
"c++"
|
||||
"cpp"
|
||||
],
|
||||
"clazy": [
|
||||
"c++"
|
||||
"cpp"
|
||||
],
|
||||
"clj_kondo": [
|
||||
"clojure"
|
||||
],
|
||||
"cppcheck": [
|
||||
"c",
|
||||
"c++"
|
||||
"cpp"
|
||||
],
|
||||
"cpplint": [
|
||||
"c",
|
||||
"c++"
|
||||
"cpp"
|
||||
],
|
||||
"dartanalyzer": [
|
||||
"dart"
|
||||
|
@ -245,7 +245,7 @@
|
|||
],
|
||||
"gcc": [
|
||||
"c",
|
||||
"c++"
|
||||
"cpp"
|
||||
],
|
||||
"gitlint": [
|
||||
"gitcommit"
|
||||
|
@ -260,7 +260,7 @@
|
|||
"go"
|
||||
],
|
||||
"hadolint": [
|
||||
"docker"
|
||||
"dockerfile"
|
||||
],
|
||||
"joker": [
|
||||
"clojure"
|
||||
|
@ -278,7 +278,7 @@
|
|||
"lua"
|
||||
],
|
||||
"mcs": [
|
||||
"c#"
|
||||
"cs"
|
||||
],
|
||||
"mypy": [
|
||||
"python"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue