This commit is contained in:
Zoe Roux
2022-04-29 10:52:37 +02:00
parent 767c4dc180
commit 291989d274
2 changed files with 9 additions and 15 deletions

View File

@@ -18,7 +18,7 @@ M.list = function()
return ret
end
M.build = function(proj, opts)
M.build = function(proj)
local function add_to_qf(err, data)
vim.fn.setqflist({}, "a", {
efm = [[%f(%l\,%c): %t%*[^ ] %m]],
@@ -26,12 +26,12 @@ M.build = function(proj, opts)
})
end
return Job:new(vim.tbl_deep_extend("force", opts, {
return Job:new({
command = "dotnet",
args = { "build", proj.csproj },
on_stdout = vim.schedule_wrap(add_to_qf),
on_stderr = vim.schedule_wrap(add_to_qf),
}))
})
end

View File

@@ -51,13 +51,6 @@ M.get_project = function ()
return M.projects[vim.fn.getcwd()]
end
M.post_build = function ()
vim.g.errorformat = M._old_efm
if M._post_callback then
M._post_callback(vim.g.asyncrun_code)
end
end
M.build = function (post)
local proj = M.get_project()
if not proj then
@@ -69,11 +62,11 @@ M.build = function (post)
title = proj.icon .. " " .. proj.name,
})
vim.api.nvim_command('copen')
vim.api.nvim_command('wincmd p')
vim.api.nvim_command('wincmd p')
proj.adapter.build(proj, {
on_exit = post,
}):start()
proj.adapter.build(proj)
:and_then(post)
:start()
end
M.run = function ()
@@ -93,7 +86,8 @@ M.run = function ()
return
end
vim.api.nvim_command(":cclose")
proj.adapter.run(proj):Start()
local buf = vim,api.nvim_create_buf(false, true)
proj.adapter.run(proj):start()
-- vim.cmd(":AsyncRun -mode=terminal -focus=0 -rows=" .. M.config.height .. " " .. proj.adapter.run(proj))
end