mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
fix(lsp): prevent lsp tests from picking up local user config (#22606)
Sets `NVIM_APPNAME` for the lsp server instances and also for the `exec_lua` environment to ensure local user config doesn't interfere with the test cases. My local `ftplugin/xml.lua` broke the LSP test cases about setting `omnifunc` defaults.
This commit is contained in:

committed by
GitHub

parent
762a06c6bc
commit
d3c8d104bc
@@ -13,6 +13,7 @@ function M.clear_notrace()
|
|||||||
-- solution: don't look too closely for dragons
|
-- solution: don't look too closely for dragons
|
||||||
clear {env={
|
clear {env={
|
||||||
NVIM_LUA_NOTRACK="1";
|
NVIM_LUA_NOTRACK="1";
|
||||||
|
NVIM_APPNAME="nvim_lsp_test";
|
||||||
VIMRUNTIME=os.getenv"VIMRUNTIME";
|
VIMRUNTIME=os.getenv"VIMRUNTIME";
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
@@ -85,6 +86,7 @@ local function fake_lsp_server_setup(test_name, timeout_ms, options, settings)
|
|||||||
cmd_env = {
|
cmd_env = {
|
||||||
NVIM_LOG_FILE = fake_lsp_logfile;
|
NVIM_LOG_FILE = fake_lsp_logfile;
|
||||||
NVIM_LUA_NOTRACK = "1";
|
NVIM_LUA_NOTRACK = "1";
|
||||||
|
NVIM_APPNAME = "nvim_lsp_test";
|
||||||
};
|
};
|
||||||
cmd = {
|
cmd = {
|
||||||
vim.v.progpath, '-l', fake_lsp_code, test_name, tostring(timeout),
|
vim.v.progpath, '-l', fake_lsp_code, test_name, tostring(timeout),
|
||||||
|
@@ -57,6 +57,7 @@ describe('LSP', function()
|
|||||||
return lsp.start_client {
|
return lsp.start_client {
|
||||||
cmd_env = {
|
cmd_env = {
|
||||||
NVIM_LOG_FILE = fake_lsp_logfile;
|
NVIM_LOG_FILE = fake_lsp_logfile;
|
||||||
|
NVIM_APPNAME = "nvim_lsp_test";
|
||||||
};
|
};
|
||||||
cmd = {
|
cmd = {
|
||||||
vim.v.progpath, '-l', fake_lsp_code, test_name;
|
vim.v.progpath, '-l', fake_lsp_code, test_name;
|
||||||
|
Reference in New Issue
Block a user