Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildtargets #536

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e7b8105
feat: buildtargets
Dec 22, 2024
d88d329
fixup! feat: buildtargets
Dec 23, 2024
4bb4d3c
fixup! fixup! feat: buildtargets
Dec 23, 2024
08290f6
fixup! fixup! fixup! feat: buildtargets
Dec 23, 2024
3107819
fixup! fixup! fixup! fixup! feat: buildtargets
Dec 23, 2024
d5c1b72
fixup! fixup! fixup! fixup! fixup! feat: buildtargets
Dec 23, 2024
96918eb
fixup! fixup! fixup! fixup! fixup! fixup! feat: buildtargets
Dec 23, 2024
78cbc46
fixup! fixup! fixup! fixup! fixup! fixup! fixup! feat: buildtargets
Dec 24, 2024
b2bad1f
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! feat: buildta…
Dec 24, 2024
97a5838
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! feat: …
Dec 24, 2024
22b13ed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 25, 2024
f41962f
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 25, 2024
9723c2b
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 26, 2024
1d57961
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 26, 2024
740fac2
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 26, 2024
1e4e633
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 26, 2024
872f571
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 26, 2024
de61443
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 26, 2024
674b04f
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 26, 2024
3a2ef35
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 27, 2024
9bedb0c
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 27, 2024
d08fb9f
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 27, 2024
ae252c1
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 27, 2024
162ea29
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 28, 2024
23dafb5
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 28, 2024
febec8c
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 29, 2024
aa2babe
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 29, 2024
5aadf59
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 29, 2024
21a3b68
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 30, 2024
093d183
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 30, 2024
77accfd
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 30, 2024
931d424
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 30, 2024
a196ee1
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 31, 2024
686cb7b
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 31, 2024
9ae2a92
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 31, 2024
173e519
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions lua/go/asyncmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ local util = require('go.utils')
local log = util.log
local trace = util.trace
local getopt = require('go.alt_getopt')
local buildtargets = require("go.buildtargets")

local is_windows = util.is_windows()
local is_git_shell = is_windows
and (vim.fn.exists('$SHELL') and vim.fn.expand('$SHELL'):find('bash.exe') ~= nil)
and (vim.fn.exists('$SHELL') and vim.fn.expand('$SHELL'):find('bash.exe') ~= nil)

local function compile_efm()
local efm = [[%-G#\ %.%#]]
Expand Down Expand Up @@ -148,6 +149,28 @@ function M.make(...)

if args and #args > 0 then
cmd = vim.list_extend(cmd, reminder)
else
local co = coroutine.running()
if co then
local target_location = buildtargets.get_current_buildtarget_location()
if not target_location then
local err = buildtargets.select_buildtarget(co)
-- wait for user to select target
target_location, err = coroutine.yield()
if err then
local cmdstr = vim.fn.join(cmd, ' ')
-- error reason notified in buildtargets
vim.notify(cmdstr .. " failed", vim.log.levels.ERROR)
return
elseif not target_location then
-- user closed menu without making a selection
local cmdstr = vim.fn.join(cmd, ' ')
vim.notify(cmdstr .. " aborted", vim.log.levels.INFO)
return
end
end
cmd = vim.list_extend(cmd, { target_location })
end
end

if optarg['a'] then
Expand Down Expand Up @@ -219,9 +242,7 @@ M.runjob = function(cmd, runner, args, efm)
end

local function on_event(job_id, data, event)

if event == 'stdout' or vim.fn.empty(event) == 1 then

if data then
for _, value in ipairs(data) do
if value ~= '' then
Expand Down Expand Up @@ -286,7 +307,7 @@ M.runjob = function(cmd, runner, args, efm)
end
if next(errorlines) ~= nil and runner == 'golangci-lint' then
efm =
[[level=%tarning\ msg="%m:\ [%f:%l:%c:\ %.%#]",level=%tarning\ msg="%m",level=%trror\ msg="%m:\ [%f:%l:%c:\ %.%#]",level=%trror\ msg="%m",%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l\ %m]]
[[level=%tarning\ msg="%m:\ [%f:%l:%c:\ %.%#]",level=%tarning\ msg="%m",level=%trror\ msg="%m:\ [%f:%l:%c:\ %.%#]",level=%trror\ msg="%m",%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l\ %m]]
end

sprite.on_close()
Expand Down Expand Up @@ -318,7 +339,6 @@ M.runjob = function(cmd, runner, args, efm)
-- if quickfix is not open, open it
util.quickfix('botright copen')
end

end
if event == 'exit' then
log(info)
Expand Down Expand Up @@ -359,8 +379,8 @@ M.runjob = function(cmd, runner, args, efm)
end
vim.fn.setqflist({}, ' ', opts)
elseif vim.fn.getqflist({ title = 0 }).title == cmdstr then
vim.fn.setqflist({}, ' ', {lines = {}})
vim.api.nvim_command([[:cclose]])
vim.fn.setqflist({}, ' ', { lines = {} })
vim.api.nvim_command([[:cclose]])
end

if tonumber(data) ~= 0 then
Expand All @@ -383,7 +403,8 @@ M.runjob = function(cmd, runner, args, efm)
if not failed then
f = ' finished '
end
local output = string.format('%s %s message: %s with code %d', info, f, vim.inspect(errorlines), vim.v.shell_error)
local output = string.format('%s %s message: %s with code %d', info, f, vim.inspect(errorlines),
vim.v.shell_error)
vim.notify(output, level)
else
local output = info .. ' succeed '
Expand Down
Loading
Loading