Skip to content

Commit ac832d0

Browse files
Merge pull request #35 from jonathanmorris180/fix/issue-34
Fix LWC issue
2 parents 26caff5 + f56ac28 commit ac832d0

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

lua/salesforce/file_manager.lua

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ local function push_to_org_callback(j)
5252
and sfdx_response.result.details.componentFailures
5353
then
5454
local diagnostics = {}
55+
local problems = {}
5556
for _, failure in ipairs(sfdx_response.result.details.componentFailures) do
5657
if failure.problem and failure.lineNumber and failure.columnNumber then
5758
table.insert(diagnostics, {
@@ -60,15 +61,33 @@ local function push_to_org_callback(j)
6061
message = failure.problem,
6162
severity = vim.diagnostic.severity.ERROR,
6263
})
64+
elseif
65+
failure.problem
66+
and not failure.lineNumber
67+
and not failure.columnNumber
68+
then
69+
table.insert(problems, failure.problem)
6370
end
6471
end
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-
)
72+
if #diagnostics > 0 then
73+
Util.set_error_diagnostics(diagnostics)
74+
vim.notify(
75+
string.format(
76+
"Error(s) while pushing %s. Check diagnostics. Overlapping messages from apex_ls have been omitted.",
77+
file_name
78+
),
79+
vim.log.levels.ERROR
80+
)
81+
elseif #problems > 0 and #diagnostics == 0 then
82+
vim.notify(
83+
string.format(
84+
"Error(s) while pushing %s: %s",
85+
file_name,
86+
table.concat(problems, ", ")
87+
),
88+
vim.log.levels.ERROR
89+
)
90+
end
7291
return
7392
elseif sfdx_response.message then
7493
vim.notify(sfdx_response.message, vim.log.levels.ERROR)

0 commit comments

Comments
 (0)