Skip to content

Commit

Permalink
Merge pull request #45 from jonathanmorris180/fix/issue-39
Browse files Browse the repository at this point in the history
Fix/issue 39
  • Loading branch information
jonathanmorris180 authored Aug 8, 2024
2 parents 1b3b08b + 0e55ba1 commit cee438a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lua/salesforce/diff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ local function expand(t)
end

local function execute_job(args)
local all_args = { "project", "retrieve", "start", unpack(expand(args)) }
local all_args = { "project", "retrieve", "start", "--ignore-conflicts", unpack(expand(args)) } -- always ignore when retrieving temp files
table.insert(all_args, "--json")
Debug:log("diff.lua", "Command: ")
Debug:log("diff.lua", all_args)
Expand Down
6 changes: 4 additions & 2 deletions lua/salesforce/file_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end
local M = {}

local executable = Util.get_sf_executable()
local active_file_path = nil
local active_file_path

local function push_to_org_callback(j)
vim.schedule(function()
Expand Down Expand Up @@ -70,7 +70,7 @@ local function push_to_org_callback(j)
end
end
if #diagnostics > 0 then
Util.set_error_diagnostics(diagnostics)
Util.set_error_diagnostics(diagnostics, M.current_bufnr)
vim.notify(
string.format(
"Error(s) while pushing %s. Check diagnostics. Overlapping messages from apex_ls have been omitted.",
Expand Down Expand Up @@ -180,6 +180,7 @@ local function push(command)

if not M.current_job or not M.current_job:is_running() then
M.current_job = new_job
M.current_bufnr = vim.api.nvim_get_current_buf()
M.current_job:start()
else
Util.notify_command_in_progress("push/pull")
Expand All @@ -206,6 +207,7 @@ local function pull(command)

if not M.current_job or not M.current_job:is_running() then
M.current_job = new_job
M.current_bufnr = vim.api.nvim_get_current_buf()
M.current_job:start()
else
Util.notify_command_in_progress("push/pull")
Expand Down
3 changes: 1 addition & 2 deletions lua/salesforce/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ local function get_apex_ls_namespace()
end
end

function M.set_error_diagnostics(diagnostics)
function M.set_error_diagnostics(diagnostics, bufnr)
local apex_ls_namespace = get_apex_ls_namespace()
local bufnr = vim.api.nvim_get_current_buf()
-- filter out overlapping diagnostics from apex_ls
local filtered_diagnostics = {}
for _, diagnostic in ipairs(diagnostics) do
Expand Down

0 comments on commit cee438a

Please sign in to comment.