summaryrefslogtreecommitdiff
path: root/tests/minimal_lsp.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-11-02 17:03:21 +0100
committerkylo252 <[email protected]>2021-11-02 17:03:21 +0100
commitb04bb9b79864e846af8936d6cee6ced0dd0bf93e (patch)
tree1d4d0a40330f426b51b8d62409d23869887bf7dd /tests/minimal_lsp.lua
parent17648e5a07f8c4fe851b09f3037db58c73fe292f (diff)
parent32ca5afa4ad21f1a616cc30323c272191e7548c1 (diff)
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'tests/minimal_lsp.lua')
-rw-r--r--tests/minimal_lsp.lua25
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/minimal_lsp.lua b/tests/minimal_lsp.lua
index a2b9ab57..9873e5ef 100644
--- a/tests/minimal_lsp.lua
+++ b/tests/minimal_lsp.lua
@@ -1,8 +1,25 @@
+local on_windows = vim.loop.os_uname().version:match "Windows"
+
+local function join_paths(...)
+ local path_sep = on_windows and "\\" or "/"
+ local result = table.concat({ ... }, path_sep)
+ return result
+end
+
vim.cmd [[set runtimepath=$VIMRUNTIME]]
-vim.cmd [[set packpath=/tmp/nvim/site]]
-local package_root = "/tmp/nvim/site/pack"
-local install_path = package_root .. "/packer/start/packer.nvim"
+local temp_dir
+if on_windows then
+ temp_dir = vim.loop.os_getenv "TEMP"
+else
+ temp_dir = "/tmp"
+end
+
+vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site"))
+
+local package_root = join_paths(temp_dir, "nvim", "site", "pack")
+local install_path = join_paths(package_root, "packer", "start", "packer.nvim")
+local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua")
-- Choose whether to use the executable that's managed by lsp-installer
local use_lsp_installer = true
@@ -16,7 +33,7 @@ local function load_plugins()
},
config = {
package_root = package_root,
- compile_path = install_path .. "/plugin/packer_compiled.lua",
+ compile_path = compile_path,
},
}
end