Hi @mauroapo, it looks like the issue is occurring because the file path isn't getting resolved correctly (it seems double backslashes are getting added). It's looking for C:\\Users\\Acer\\Documents\\Projetos\\Salesforce\\ResourcefulPanda\\force-app\\main\\default\\classes\\WarehouseCalloutService.cls, which results in ENOENT: no such file or directory. The code that retrieves the file path is here. Could you please run the following in your Neovim command line and let me know what they print?
@mauroapo Can you please try changing the sf_executable to sf.cmd in your configuration of salesforce.nvim as proposed here? I believe this may be the fix (theoretically it should detect the OS and update the executable accordingly, but I think this may not be working as expected).
Hello, I'm sorry for the delay. It has been a busy week.
I did the change as requested but the issue persist. Here are the steps I did:
1 - opened the salesforce/config.lua file
2 - change the sf_executable to sf.cmd
3 - opened the salesforce file I want to push with nvim
4 - did the SalesforcePushToOrgCommand
Then I tried changing the executable variable inside the lua files. And it worked as expected.
I added all the changes to https://github.com/mauroapo/salesforce.nvim/commit/5fcd265a165c9c916feb709275a0f4252ed59de9 for you to check. In it you'll see the changes in the config.lua, that didn't solve the issue, and the changes for file_manager.lua and diff.lua, that solved the issue.
I can move the if from config.lua to all files if you think that's the way to go. Something curious though is that the commands in org_manager.lua didn't present the same issue and have always worked properly
Thanks for that info @mauroapo. It looks like there's a bug in the code that results in the executable not being recognized because of the order in which things get loaded on startup. Can you please let me know what prints in your terminal with the following command? I think I have a good way to solve this issue, but I want to check that it will be compatible with Windows first:
Hi @mauroapo, I have added a fix for this in #41. Can you please pull down the fix/issue-40 branch and try it out? You would have to specify the branch in your plugin manager and possibly reinstall the plugin using that branch. After you have confirmed that it's working for you, I'll merge it into main.
Description
Steps to reproduce
Expected the class to be pushed to the org
Environment
Other comments
I did the command below inside of the same terminal I was executing the :SalesforcePushToOrg command
:terminal sf project deploy start --json -o mauro.apo123@resourceful-panda-v0tc3s.com -d C:\Users\Acer\Documents\Projetos\Salesforce\ResourcefulPanda\force-app\main\default\classes\WarehouseCalloutService.cls
and it worked fine
Hi @mauroapo, it looks like the issue is occurring because the file path isn't getting resolved correctly (it seems double backslashes are getting added). It's looking for
C:\\Users\\Acer\\Documents\\Projetos\\Salesforce\\ResourcefulPanda\\force-app\\main\\default\\classes\\WarehouseCalloutService.cls
, which results inENOENT: no such file or directory
. The code that retrieves the file path is here. Could you please run the following in your Neovim command line and let me know what they print?I believe it has to have double backslashes on windows
I added the following code to my init file to debug but the same problem occurs
First command response:![image](https://github.com/jonathanmorris180/salesforce.nvim/assets/49110280/f055c835-6ae0-4d7f-9bbb-828e508f7276)
Second command response:![image](https://github.com/jonathanmorris180/salesforce.nvim/assets/49110280/24665fdd-354b-429d-b2bf-c0b411548267)
@mauroapo Can you please try changing the
sf_executable
tosf.cmd
in your configuration of salesforce.nvim as proposed here? I believe this may be the fix (theoretically it should detect the OS and update the executable accordingly, but I think this may not be working as expected).@mauroapo Did you try the fix above?
Hello, I'm sorry for the delay. It has been a busy week. I did the change as requested but the issue persist. Here are the steps I did:
1 - opened the salesforce/config.lua file 2 - change the sf_executable to sf.cmd 3 - opened the salesforce file I want to push with nvim 4 - did the SalesforcePushToOrgCommand
Then I tried changing the
executable
variable inside the lua files. And it worked as expected.I added all the changes to https://github.com/mauroapo/salesforce.nvim/commit/5fcd265a165c9c916feb709275a0f4252ed59de9 for you to check. In it you'll see the changes in the config.lua, that didn't solve the issue, and the changes for file_manager.lua and diff.lua, that solved the issue. I can move the if from config.lua to all files if you think that's the way to go. Something curious though is that the commands in org_manager.lua didn't present the same issue and have always worked properly
Thanks for that info @mauroapo. It looks like there's a bug in the code that results in the executable not being recognized because of the order in which things get loaded on startup. Can you please let me know what prints in your terminal with the following command? I think I have a good way to solve this issue, but I want to check that it will be compatible with Windows first:
Thanks for helping to debug this!
Hello @jonathanmorris180, after executing the command this was the return:
I hope it helps :)
Hi @mauroapo, I have added a fix for this in #41. Can you please pull down the fix/issue-40 branch and try it out? You would have to specify the branch in your plugin manager and possibly reinstall the plugin using that branch. After you have confirmed that it's working for you, I'll merge it into main.
Hi @mauroapo, were you able to try out the fix from #41?
@jonathanmorris180 just tested the changes. It is working well