Skip to content

Commit

Permalink
Merge pull request scalameta#620 from ckipp01/emptBuildTarget
Browse files Browse the repository at this point in the history
fix: don't display picker when no build targets are returned
  • Loading branch information
ckipp01 authored Oct 20, 2023
2 parents 7e30210 + 9a45aa8 commit dfcb4f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/metals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ M.show_build_target_info = function()
if err then
log.error_and_show(string.format("Unable to retrieve build targets", method))
log.error(err)
elseif resp then
elseif resp and not vim.tbl_isempty(resp) then
vim.ui.select(resp, {
prompt = "Choose build target to view:",
}, function(choice)
Expand All @@ -374,7 +374,7 @@ M.show_build_target_info = function()
end
end)
else
log.warn_and_show("Metals returned no info for build target.")
log.warn_and_show("Metals returned no info for build targets. If you're still importing, wait and try again.")
end
end
execute_command({ command = "metals.list-build-targets" }, choose_and_decode)
Expand Down

0 comments on commit dfcb4f5

Please sign in to comment.