This commit is contained in:
ray-x 2023-11-01 02:20:13 +11:00
parent dfc692486b
commit d5eac9dffc
2 changed files with 18 additions and 2 deletions

17
.luarc.json Normal file
View File

@ -0,0 +1,17 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.diagnostics.globals": [
"vim",
"describe",
"it",
"before_each",
"after_each",
"teardown",
"pending",
"lfs"
],
"Lua.workspace.checkThirdParty": false,
"Lua.workspace.library": [
"${3rd}/lfs/library"
]
}

View File

@ -41,15 +41,14 @@ describe('should run gopls releated functions', function()
end)
it('should run import from file with gopls', function()
vim.cmd('%bdelete!')
local path = 'fmt/goimports3.go' -- %:p:h ? %:p
local expected =
vim.fn.join(vim.fn.readfile(cur_dir .. '/lua/tests/fixtures/fmt/goimports3_golden.go'), '\n')
vim.cmd('cd ' .. godir)
local path = './fmt/goimports3.go' -- %:p:h ? %:p
local cmd = " silent exe 'e " .. path .. "'"
vim.cmd(cmd)
vim.cmd([[cd %:p:h]])
vim.wait(2000, function()
return false
end)