mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-23 10:48:30 +02:00
fix(tests): set up lazy.nvim in the lsp test (#4088)
This commit is contained in:
parent
4cefc89506
commit
6c66357cb1
4 changed files with 12 additions and 7 deletions
6
.github/workflows/install.yaml
vendored
6
.github/workflows/install.yaml
vendored
|
@ -21,10 +21,10 @@ jobs:
|
||||||
include:
|
include:
|
||||||
- runner: ubuntu-latest
|
- runner: ubuntu-latest
|
||||||
os: linux
|
os: linux
|
||||||
neovim: v0.8.0
|
neovim: v0.9.0
|
||||||
- runner: macos-latest
|
- runner: macos-latest
|
||||||
os: osx
|
os: osx
|
||||||
neovim: v0.8.0
|
neovim: v0.9.0
|
||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
os: linux
|
os: linux
|
||||||
neovim: nightly
|
neovim: nightly
|
||||||
|
@ -78,7 +78,7 @@ jobs:
|
||||||
uses: rhysd/action-setup-vim@v1
|
uses: rhysd/action-setup-vim@v1
|
||||||
with:
|
with:
|
||||||
neovim: true
|
neovim: true
|
||||||
version: v0.8.0
|
version: v0.9.0
|
||||||
|
|
||||||
- name: Install LunarVim
|
- name: Install LunarVim
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
|
|
|
@ -2,6 +2,7 @@ local skipped_servers = {
|
||||||
"angularls",
|
"angularls",
|
||||||
"ansiblels",
|
"ansiblels",
|
||||||
"antlersls",
|
"antlersls",
|
||||||
|
"azure_pipelines_ls",
|
||||||
"ccls",
|
"ccls",
|
||||||
"csharp_ls",
|
"csharp_ls",
|
||||||
"cssmodules_ls",
|
"cssmodules_ls",
|
||||||
|
@ -22,6 +23,7 @@ local skipped_servers = {
|
||||||
"phpactor",
|
"phpactor",
|
||||||
"psalm",
|
"psalm",
|
||||||
"pylsp",
|
"pylsp",
|
||||||
|
"pylyzer",
|
||||||
"pyre",
|
"pyre",
|
||||||
"quick_lint_js",
|
"quick_lint_js",
|
||||||
"reason_ls",
|
"reason_ls",
|
||||||
|
@ -39,6 +41,7 @@ local skipped_servers = {
|
||||||
"spectral",
|
"spectral",
|
||||||
"sqlls",
|
"sqlls",
|
||||||
"sqls",
|
"sqls",
|
||||||
|
"standardrb",
|
||||||
"stylelint_lsp",
|
"stylelint_lsp",
|
||||||
"svlangserver",
|
"svlangserver",
|
||||||
"tflint",
|
"tflint",
|
||||||
|
|
|
@ -55,6 +55,7 @@ end
|
||||||
---@param filter { filetype: string | string[] }?: (optional) Used to filter the list of server names.
|
---@param filter { filetype: string | string[] }?: (optional) Used to filter the list of server names.
|
||||||
---@return string[] list of names of supported servers
|
---@return string[] list of names of supported servers
|
||||||
function M.get_supported_servers(filter)
|
function M.get_supported_servers(filter)
|
||||||
|
require("mason-registry").refresh()
|
||||||
local _, supported_servers = pcall(function()
|
local _, supported_servers = pcall(function()
|
||||||
return require("mason-lspconfig").get_available_servers(filter)
|
return require("mason-lspconfig").get_available_servers(filter)
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -21,6 +21,9 @@ a.describe("lsp workflow", function()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
lvim.lsp.templates_dir = join_paths(get_cache_dir(), "artifacts")
|
lvim.lsp.templates_dir = join_paths(get_cache_dir(), "artifacts")
|
||||||
|
vim.go.loadplugins = true
|
||||||
|
local plugins = require "lvim.plugins"
|
||||||
|
require("lvim.plugin-loader").load { plugins, lvim.plugins }
|
||||||
|
|
||||||
a.it("should be able to delete ftplugin templates", function()
|
a.it("should be able to delete ftplugin templates", function()
|
||||||
if utils.is_directory(lvim.lsp.templates_dir) then
|
if utils.is_directory(lvim.lsp.templates_dir) then
|
||||||
|
@ -36,14 +39,14 @@ a.describe("lsp workflow", function()
|
||||||
|
|
||||||
require("lvim.lsp").setup()
|
require("lvim.lsp").setup()
|
||||||
|
|
||||||
assert.True(utils.is_directory(lvim.lsp.templates_dir))
|
assert.True(#vim.fn.glob(lvim.lsp.templates_dir .. "/*.lua", 1, 1) > 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
a.it("should not include blacklisted servers in the generated templates", function()
|
a.it("should not include blacklisted servers in the generated templates", function()
|
||||||
require("lvim.lsp").setup()
|
require("lvim.lsp").setup()
|
||||||
|
|
||||||
for _, file in ipairs(vim.fn.glob(lvim.lsp.templates_dir .. "/*.lua", 1, 1)) do
|
for _, file in ipairs(vim.fn.glob(lvim.lsp.templates_dir .. "/*.lua", 1, 1)) do
|
||||||
for _, server_name in ipairs(lvim.lsp.override) do
|
for _, server_name in ipairs(lvim.lsp.automatic_configuration.skipped_servers) do
|
||||||
local setup_cmd = string.format([[require("lvim.lsp.manager").setup(%q)]], server_name)
|
local setup_cmd = string.format([[require("lvim.lsp.manager").setup(%q)]], server_name)
|
||||||
assert.False(helpers.file_contains(file, setup_cmd))
|
assert.False(helpers.file_contains(file, setup_cmd))
|
||||||
end
|
end
|
||||||
|
@ -76,8 +79,6 @@ a.describe("lsp workflow", function()
|
||||||
|
|
||||||
a.it("should not attempt to re-generate ftplugin templates", function()
|
a.it("should not attempt to re-generate ftplugin templates", function()
|
||||||
local s = spy.on(require "lvim.lsp.templates", "generate_templates")
|
local s = spy.on(require "lvim.lsp.templates", "generate_templates")
|
||||||
local plugins = require "lvim.plugins"
|
|
||||||
require("lvim.plugin-loader").load { plugins, lvim.plugins }
|
|
||||||
|
|
||||||
require("lvim.lsp").setup()
|
require("lvim.lsp").setup()
|
||||||
assert.spy(s).was_not_called()
|
assert.spy(s).was_not_called()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue