local t = require('test.testutil')
local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
local t_lsp = require('test.functional.plugin.lsp.testutil')
local describe, it, before_each, after_each = t.describe, t.it, t.before_each, t.after_each
local feed = n.feed
local eq = t.eq
local exec_lua = n.exec_lua
local pcall_err = t.pcall_err
local stop = n.stop
local read_file = t.read_file
local write_file = t.write_file
local api = n.api
local is_os = t.is_os
local skip = t.skip
local command = n.command
local fn = n.fn
local tmpname = t.tmpname
local clear_notrace = t_lsp.clear_notrace
local create_server_definition = t_lsp.create_server_definition
-- TODO(justinmk): hangs on Windows https://github.com/neovim/neovim/pull/11837
if skip(is_os('win')) then
return
end
describe('vim.lsp.util', function()
before_each(function()
clear_notrace()
end)
after_each(function()
stop()
exec_lua(function()
vim.iter(vim.lsp.get_clients({ _uninitialized = true })):each(function(client)
client:stop(true)
end)
end)
api.nvim_exec_autocmds('VimLeavePre', { modeline = false })
end)
describe('lsp.util.rename', function()
local pathsep = n.get_pathsep()
it('can rename an existing file', function()
local old = tmpname()
write_file(old, 'Test content')
local new = tmpname(false)
local lines
|