diff options
| author | Julian Berman <Julian@GrayVines.com> | 2022-02-18 09:46:17 -0500 |
|---|---|---|
| committer | Julian Berman <Julian@GrayVines.com> | 2022-02-18 09:46:17 -0500 |
| commit | 5be12270db85a3f21467b5d7e4745defd1f167a9 (patch) | |
| tree | d5ed64b7711da2fe7dcf4155dba329927c16c24e /lua/lspconfig/server_configurations/leanls.lua | |
| parent | fix(leanls): support new src/lean directory (diff) | |
| download | nvim-lspconfig-5be12270db85a3f21467b5d7e4745defd1f167a9.tar nvim-lspconfig-5be12270db85a3f21467b5d7e4745defd1f167a9.tar.gz nvim-lspconfig-5be12270db85a3f21467b5d7e4745defd1f167a9.tar.bz2 nvim-lspconfig-5be12270db85a3f21467b5d7e4745defd1f167a9.tar.lz nvim-lspconfig-5be12270db85a3f21467b5d7e4745defd1f167a9.tar.xz nvim-lspconfig-5be12270db85a3f21467b5d7e4745defd1f167a9.tar.zst nvim-lspconfig-5be12270db85a3f21467b5d7e4745defd1f167a9.zip | |
fix(leanls): move legacy_cmd -> options.non_lake_lsp_cmd
Diffstat (limited to 'lua/lspconfig/server_configurations/leanls.lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/leanls.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lua/lspconfig/server_configurations/leanls.lua b/lua/lspconfig/server_configurations/leanls.lua index b49f214c..208598af 100644 --- a/lua/lspconfig/server_configurations/leanls.lua +++ b/lua/lspconfig/server_configurations/leanls.lua @@ -3,9 +3,6 @@ local util = require 'lspconfig.util' return { default_config = { cmd = { 'lake', 'serve', '--' }, - -- Only Lake 3.0+ supports lake serve, so for old enough Lean 4, - -- we fallback to the builtin LSP. - legacy_cmd = { 'lean', '--server' }, filetypes = { 'lean' }, root_dir = function(fname) -- check if inside elan stdlib @@ -28,6 +25,12 @@ return { or stdlib_dir or util.find_git_ancestor(fname) end, + options = { + -- Only Lake 3.0+ supports lake serve, so for old enough Lean 4, + -- or core Lean itself, this command (typically using the in-built + -- Lean 4 language server) will be used instead. + no_lake_lsp_cmd = { 'lean', '--server' }, + }, on_new_config = function(config, root_dir) local use_lake_serve = false if util.path.exists(util.path.join(root_dir, 'lakefile.lean')) then @@ -46,7 +49,7 @@ return { end end if not use_lake_serve then - config.cmd = config.legacy_cmd + config.cmd = config.options.no_lake_lsp_cmd end -- add root dir as command-line argument for `ps aux` table.insert(config.cmd, root_dir) |
