From 1a2415ef115f100b018fc02285070aa640d503b2 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Tue, 4 Jan 2022 16:31:21 +0100 Subject: feat(leanls): add root dir as command-line arg (#1634) The argument is ignored by the server, but it is useful because it is shown by `htop`, `ps ax`, etc., so you can figure out which Lean servers are running. The lean3ls doesn't require a corresponding change: we use the `lean-language-server` wrapper, which appends the root directory itself to the wrapped `lean --server` command. --- lua/lspconfig/server_configurations/leanls.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/leanls.lua b/lua/lspconfig/server_configurations/leanls.lua index efefa913..52d55545 100644 --- a/lua/lspconfig/server_configurations/leanls.lua +++ b/lua/lspconfig/server_configurations/leanls.lua @@ -19,6 +19,10 @@ return { or stdlib_dir or util.find_git_ancestor(fname) end, + on_new_config = function(config, root_dir) + -- add root dir as command-line argument for `ps aux` + table.insert(config.cmd, root_dir) + end, single_file_support = true, }, docs = { -- cgit v1.2.3-70-g09d2