aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/rpc.lua
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2022-05-22 13:21:44 -0600
committerGitHub <noreply@github.com>2022-05-22 12:21:44 -0700
commit378615b8ee9440edb9ab7c71d847d03d52c61b2f (patch)
tree5db7f562bc7d956957b6fb7f48f39624f04cb250 /runtime/lua/vim/lsp/rpc.lua
parent52623ce9353bac2b4a82c0197c5a08202e74b156 (diff)
downloadrneovim-378615b8ee9440edb9ab7c71d847d03d52c61b2f.tar.gz
rneovim-378615b8ee9440edb9ab7c71d847d03d52c61b2f.tar.bz2
rneovim-378615b8ee9440edb9ab7c71d847d03d52c61b2f.zip
fix(lsp): do not detach LSP servers on Windows #18703
Detaching the process seems to have unintended side effects on Windows, so only do it by default on non-Windows platforms. Ref: https://github.com/neovim/nvim-lspconfig/issues/1907 Closes https://github.com/neovim/nvim-lspconfig/pull/1913
Diffstat (limited to 'runtime/lua/vim/lsp/rpc.lua')
-rw-r--r--runtime/lua/vim/lsp/rpc.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua
index 2dcafc92bc..ad2498fb6f 100644
--- a/runtime/lua/vim/lsp/rpc.lua
+++ b/runtime/lua/vim/lsp/rpc.lua
@@ -4,6 +4,8 @@ local log = require('vim.lsp.log')
local protocol = require('vim.lsp.protocol')
local validate, schedule, schedule_wrap = vim.validate, vim.schedule, vim.schedule_wrap
+local is_win = uv.os_uname().version:find('Windows')
+
---@private
--- Checks whether a given path exists and is a directory.
---@param filename (string) path to check
@@ -321,7 +323,7 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
local spawn_params = {
args = cmd_args,
stdio = { stdin, stdout, stderr },
- detached = true,
+ detached = not is_win,
}
if extra_spawn_params then
spawn_params.cwd = extra_spawn_params.cwd