@@ -51,14 +51,24 @@ local function push_to_org_callback(j)
5151 and sfdx_response .result .details
5252 and sfdx_response .result .details .componentFailures
5353 then
54- local failures = {}
54+ local diagnostics = {}
5555 for _ , failure in ipairs (sfdx_response .result .details .componentFailures ) do
56- if failure .problem then
57- table.insert (failures , failure .problem )
56+ if failure .problem and failure .lineNumber and failure .columnNumber then
57+ table.insert (diagnostics , {
58+ lnum = failure .lineNumber - 1 ,
59+ col = failure .columnNumber - 1 ,
60+ message = failure .problem ,
61+ severity = vim .diagnostic .severity .ERROR ,
62+ })
5863 end
5964 end
60- vim .notify (" Error(s) while pushing " .. file_name , vim .log .levels .ERROR )
61- vim .notify (table.concat (failures , " \n " ), vim .log .levels .ERROR )
65+ Util .set_error_diagnostics (diagnostics )
66+ vim .notify (
67+ " Error(s) while pushing "
68+ .. file_name
69+ .. " . Check diagnostics. Overlapping messages from apex_ls have been omitted." ,
70+ vim .log .levels .ERROR
71+ )
6272 return
6373 elseif sfdx_response .message then
6474 vim .notify (sfdx_response .message , vim .log .levels .ERROR )
@@ -184,6 +194,7 @@ local function pull(command)
184194end
185195
186196M .push_to_org = function ()
197+ Util .clear_error_diagnostics ()
187198 active_file_path = vim .fn .expand (" %:p" )
188199 local file_name = vim .fn .fnamemodify (active_file_path , " :t" )
189200 local default_username = OrgManager :get_default_username ()
@@ -208,6 +219,7 @@ M.push_to_org = function()
208219end
209220
210221M .pull_from_org = function ()
222+ Util .clear_error_diagnostics ()
211223 active_file_path = vim .fn .expand (" %:p" )
212224 local file_name = vim .fn .fnamemodify (active_file_path , " :t" )
213225 local default_username = OrgManager :get_default_username ()
0 commit comments