-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.fnl
236 lines (224 loc) · 9.72 KB
/
config.fnl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
;; Holds the installation/update instructions.
;;
;; INTERNAL - end users should not have to edit anything in here,
;; if needed, please submit a ticket.
;; The keys, represent the name of the LSP, as defined in nvim-lspconfig:
;; https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
;;
;; The values represent a micro DSL, as follows:
;; {npm,go,pip,gem,etc.}|package1[,package2[,...]]
;; where packageN is a package installable by the corresponding command.
;; fnlfmt: skip
(local config {
:als nil
:angularls "npm|@angular/language-server"
:ansiblels "npm|ansible-language-server"
:arduino_language_server "go|github.com/arduino/arduino-language-server"
:bashls "npm|bash-language-server"
:beancount "npm|@bryall/beancount-langserver"
:bicep "bin|https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip"
:bsl_ls nil
:ccls nil
:cssmodules_ls "npm|cssmodules-language-server"
:clangd nil
:clojure_lsp "nix|clojure-lsp"
:cmake "pip|cmake-language-server"
:codeqlls "bin|https://github.com/github/codeql-cli-binaries/releases/download/v2.5.7/codeql-{linux,osx,win}64.zip"
:crystalline nil
:csharp_ls "dotnet|csharp-ls"
:cssls "npm|vscode-langservers-extracted"
:cucumber_language_server "npm|@cucumber/language-server"
:dartls nil
:denols "cargo|deno"
:dhall_lsp_server "cabal|dhall-lsp-server"
:diagnosticls "npm|diagnostic-languageserver"
:dockerls "npm|dockerfile-language-server-nodejs"
:dotls "npm|dot-language-server"
:efm "go|github.com/mattn/efm-langserver@latest"
:elixirls nil
:elmls "npm|elm,elm-test,elm-format,@elm-tooling/elm-language-server"
:ember "npm|@lifeart/ember-language-server"
:emmet_ls "npm|emmet-ls"
:erlangls nil
:esbonio "pip|esbonio"
:eslint "npm|vscode-langservers-extracted"
:flow "npm|flow-bin"
:flux_lsp "cargogit|https://github.com/influxdata/flux-lsp"
:fortls "pip|fortran-language-server"
:fsautocomplete nil
:fstar "opam|fstar"
:gdscript "bin|https://downloads.tuxfamily.org/godotengine/3.3.2/Godot_v3.3.2-stable_{linux_headless.64,osx.64,win64.exe}.zip"
:ghcide "deprecated|use hls"
:golangci_lint_ls "go|github.com/nametake/golangci-lint-langserver@latest,github.com/golangci/golangci-lint/cmd/golangci-lint"
:gopls "go|golang.org/x/tools/gopls@latest"
:grammarly "npm|@emacs-grammarly/unofficial-grammarly-language-server"
:graphql "npm|graphql-language-service-cli"
:groovyls nil
:haxe_language_server nil
:hie "deprecated|use hls"
:hls "bin|https://github.com/haskell/haskell-language-server/releases/download/1.2.0/haskell-language-server-{Linux,macOS}-1.2.0.tar.gz"
:html "npm|vscode-langservers-extracted"
:idris2_lsp nil
:intelephense "npm|intelephense"
:java_language_server nil
:jdtls nil
:jedi_language_server "pip|jedi-language-server"
:jsonls "npm|vscode-langservers-extracted"
:jsonnet_ls "go|github.com/jdbaldry/jsonnet-language-server"
:julials "julia|Pkg.add(\"LanguageServer\"); Pkg.add(\"SymbolServer\")"
:kotlin_language_server nil
:lean3ls nil
:leanls "npm|lean-language-server"
:lelwel_ls "cargo2|lelwel"
:lemminx "bin|https://download.jboss.org/jbosstools/vscode/stable/lemminx-binary/"
:ltex nil
:metals nil
:mint nil
:nickel_ls nil
:nimls "nim|nimlsp"
:ocamlls "npm|ocaml-langauge-server"
:ocamllsp "opam|ocaml-lsp-server"
:omnisharp "bin|https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.37.12/omnisharp-{linux-x64,osx,win-x64}.zip"
:pasls nil
:perlls "perl|Perl::LanguageServer"
:perlpls "perl|PLS"
:phpactor nil
:powershell_es nil
:prismals "npm|@prisma/language-server"
:psalm "composer|vimeo/psalm"
:puppet nil
:purescriptls "npm|purescript-language-server,spago,purescript"
:pylsp "pip|python-lsp-server[all]"
:pyre "pip|pyre-check"
:pyright "npm|pyright"
:quick_lint_js "npm|quick-lint-js"
:r_language_server "r|languageserver"
:racket_langserver "raco|racket-langserver"
:rescriptls nil
:rls "rust|rls,rust-analysis,rust-src"
:rnix "cargo|rnix-lsp"
:robotframework_ls nil
:rome "npm|rome"
:rust_analyzer "bin|https://github.com/rust-analyzer/rust-analyzer/releases/download/2021-07-12/rust-analyzer-x86_64-{unknown-linux-gnu,apple-darwin,pc-windows-msvc}.gz"
:scry nil
:serve_d "bin|https://github.com/Pure-D/serve-d/releases"
:sixtyfps "cargo|sixtyfps-lsp"
:solang nil
:solargraph "gem|solargraph"
:solidity_ls "npm|solidity-language-server"
:sorbet "gem|sorbet"
:sourcekit nil
:spectral "npm|spectral-language-server"
:sqlls "npm|sql-language-server"
:sqls "go|github.com/lighttiger2505/sqls@latest"
:stylelint_lsp "npm|stylelint-lsp"
:sumneko_lua nil
:svelte "npm|svelte-language-server"
:svls "cargo|svls"
:tailwindcss nil
:taplo "cargo|taplo-lsp"
:terraform_lsp "go|github.com/juliosueiras/terraform-lsp"
:terraformls "gh_bin|hashicorp/terraform-ls"
:texlab "cargogit|https://github.com/latex-lsp/texlab.git"
:tflint "go|github.com/terraform-linters/tflint@latest"
:theme_check "gem|theme-check"
:tsserver "npm|typescript,typescript-language-server"
:typeprof "gem|typeprof"
:vala_ls nil
:vdmj nil
:vimls "npm|vim-language-server"
:vls nil
:volar "npm|@volar/server"
:vuels "npm|vls"
:yamlls "npm|yaml-language-server"
:zeta_note nil
:zk nil
:zls "bin|https://github.com/zigtools/zls/releases/download/0.1.0/x86_64-{linux,macos,windows}.tar.xz"})
(local update_github_releases (require :lspupdate.github))
;; the table defines the actual commands to be run for
;; each type of install. The keys must correspond to those
;; used in the config table above, and the value represents
;; the command to be run.
;;
;; The command MUST embed a %s in it - that will be replaced
;; with the (space separated) list of packages to install.
;; fnlfmt: skip
(local commands {
:bin nil
:cabal "cabal install %s"
:cargo "cargo install %s"
:cargo2 "cargo install --features=lsp %s"
:cargogit "cargo install --locked --git %s"
:composer "composer global require %s"
:dotnet "dotnet tool install %s"
:gem "gem install -q --silent --user-install %s"
:gh_bin update_github_releases
:go "go install %s"
:julia "julia -e 'using Pkg; %s'"
:luarocks "luarocks install --local %s"
:luarocksdev "luarocks install --server=https://luarocks.org/dev --local %s"
:nim "nimble install %s"
:nix "nix-shell -p %s"
:npm "npm i --quiet -g %s"
:opam "opam install %s"
:perl "PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'install %s'"
:pip "pip3 install --user -U -q %s"
:r "R -q --slave -e \"install.packages(\\\"%s\\\",quiet=T)\""
:raco "raco pkg install %s"
:rust "rustup component add %s"})
;; by default the config.commands will be run in one go, with
;; all of their packages squashed into a single, space separated,
;; string.
;; I.e. if you have npm packages A, B and C, the command being
;; run will be `npm i [...] A B C` which will install them in
;; one go.
;; Adding a command to the `nosquash` map, prevents that behavior
;; and causes them to be run separately (but concurrently still).
(local nosquash {:go true :julia true :perl true})
;; list of known tools that can be installed/updated.
;; they get picked up automatically, taken from the
;; config of "proxy" LSPs:
;; - https://github.com/mattn/efm-langserver [DONE]
;; - https://github.com/iamcco/diagnostic-languageserver [TODO]
;; - https://github.com/jose-elias-alvarez/null-ls.nvim [TODO]
;; - https://github.com/mfussenegger/nvim-lint [TODO]
;;
;; the special "command" :nop, is to be used for commands
;; that are to be ignored from updates, such as commands
;; installed via os/package manager, and which consequently
;; will get their updates that way.
;; fnlfmt: skip
(local tools {
:eslint_d "npm|eslint_d,eslint"
:fennel "github|bakpakin/Fennel"
:fnlfmt "sourcehut|~technomancy/fnlfmt"
:golangci-lint "go|github.com/golangci/golangci-lint/cmd/golangci-lint@latest"
:jq :nop
:jsonlint "npm|jsonlint"
;:lua-format "luarocksdev|luaformatter"
:luacheck "luarocks|luacheck"
:mix "apt|mix"
:prettier "npm|preetier"
:rebar3 "apt|rebar3"
:terrascan "gh_bin_TODO|accurics/terrascan"
:tfsec "gh_bin_TODO|aquasecurity/tfsec"})
;; the table holds checks for the various commands,
;; that allow us to determine if the executables are
;; installed or not.
;; fnlfmt: skip
(local checks {
:gem {:gem [:-v "(%d+.%d+.%d+)"]}
:gh_bin {:unzip [:-v "UnZip (%d+.%d+) of"] :curl [:-V "(%d+.%d+.%d+)"]}
:go {:go [:version "go(%d+.%d+.%d+) "]}
:julia {:julia [:-v "(%d+.%d+.%d+)"]}
:luarocks {:luarocks [:--version "(%d+.%d+.%d+)"]}
:npm {:npm [:-v "(%d+.%d+.%d+)"]}
:opam {:opam [:--version "(%d+.%d+.%d+)"]}
:perl {:perl [:-v "v(%d+.%d+.%d+)"]}
:pip {:pip3 [:-V "pip (%d+.%d+.%d+)"]}
:r {:R [:--version "R version (%d+.%d+.%d+)"]}})
(fn with-user-override [default-tbl key]
(let [user-tbl (or {} (. vim.g (.. :lspupdate_ key)))]
(vim.tbl_extend :force default-tbl user-tbl)))
(collect [k tbl (pairs {: config : commands : nosquash : tools : checks})]
(values k (with-user-override tbl k)))