From 34bcbd82768e88c3b1121a8c8fb445dd2a13ec99 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 19 Feb 2022 02:56:17 +0000 Subject: docs: update server_configurations.md skip-checks: true --- doc/server_configurations.md | 23 +++++++++++++++-------- doc/server_configurations.txt | 23 +++++++++++++++-------- 2 files changed, 30 insertions(+), 16 deletions(-) (limited to 'doc') diff --git a/doc/server_configurations.md b/doc/server_configurations.md index 7c17adc8..0e436332 100644 --- a/doc/server_configurations.md +++ b/doc/server_configurations.md @@ -3979,19 +3979,26 @@ require'lspconfig'.leanls.setup{} cmd = { "lake", "serve", "--" } filetypes = { "lean" } on_new_config = function(_, d, _) - lake_version = table.concat(d, '\n') - end, - stdout_buffered = true, - }) - if lake_job > 0 and vim.fn.jobwait({ lake_job })[1] == 0 then - local major = lake_version:match 'Lake version (%d).' - if major and tonumber(major) < 3 then - config.cmd = legacy_cmd + lake_version = table.concat(d, '\n') + end, + stdout_buffered = true, + }) + if lake_job > 0 and vim.fn.jobwait({ lake_job })[1] == 0 then + local major = lake_version:match 'Lake version (%d).' + if major and tonumber(major) >= 3 then + use_lake_serve = true + end end end + if not use_lake_serve then + 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) end, + options = { + no_lake_lsp_cmd = { "lean", "--server" } + } root_dir = root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git") single_file_support = true ``` diff --git a/doc/server_configurations.txt b/doc/server_configurations.txt index 7c17adc8..0e436332 100644 --- a/doc/server_configurations.txt +++ b/doc/server_configurations.txt @@ -3979,19 +3979,26 @@ require'lspconfig'.leanls.setup{} cmd = { "lake", "serve", "--" } filetypes = { "lean" } on_new_config = function(_, d, _) - lake_version = table.concat(d, '\n') - end, - stdout_buffered = true, - }) - if lake_job > 0 and vim.fn.jobwait({ lake_job })[1] == 0 then - local major = lake_version:match 'Lake version (%d).' - if major and tonumber(major) < 3 then - config.cmd = legacy_cmd + lake_version = table.concat(d, '\n') + end, + stdout_buffered = true, + }) + if lake_job > 0 and vim.fn.jobwait({ lake_job })[1] == 0 then + local major = lake_version:match 'Lake version (%d).' + if major and tonumber(major) >= 3 then + use_lake_serve = true + end end end + if not use_lake_serve then + 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) end, + options = { + no_lake_lsp_cmd = { "lean", "--server" } + } root_dir = root_pattern("lakefile.lean", "lean-toolchain", "leanpkg.toml", ".git") single_file_support = true ``` -- cgit v1.3.1