15

How to enable or configure "Salesforce Extensions for VS Code" plugin on Visual studio code IDE to compile my Apex,Visualforce on the scratch org when I save the file locally.

I have just started using it and I have to manually run the command sfdx force:source:push either from command prompt or from the command pallette in IDE.

Is there an easy option like we had in Mavensmate and Force IDE?

Update

I opened issue with salesforcedx-vscode project:

2
  • 1
    Most recent update from the GutHub issue: This isn't on our roadmap at this time. We are looking into what we can do to improve the Aura and Visualforce language servers, but we don't have any timeline right now.
    – Robs
    Commented Sep 12, 2018 at 16:35
  • @Robs I have seen on one of the blogs that they are suggesting nodemon util to get this working as a workaround. Because there is a workaround maybe they are not treating as high priority.
    – javanoob
    Commented Sep 12, 2018 at 16:37

3 Answers 3

5

You can't compile your code automatically like you did before with the first version of the Eclipse plugin. The new plugin makes use of the Language Server Protocole which will help you find errors locally, but you'll still have to use sfdx force:source:push to compile everything.

If you have access to the Trailblazer Community, there is a thread about this here.

Additionally, you can automatically push your changes to your Scratch Org using Nodemon, as described in this blog post.

6
  • Thanks. Both the links are pointing to the same github url. Also, it is not showing any error message in VScode if I write any gibberish. Here is the screenshot: imgur.com/a/BnTIJ
    – javanoob
    Commented Oct 30, 2017 at 14:29
  • 1
    Sorry, updated the link ^^Not sure what is currently supported by the language server, it's a good question. You could either ask on the Chatter post or directly on the SalesforceDX vscode plugin github: github.com/forcedotcom/salesforcedx-vscode/issues Commented Oct 30, 2017 at 14:37
  • Thanks. Luckily, I was part of pilot program so have access to the community. Posted a comment for Wade and Josh. I hope they will look into it and provide update. Thanks again.
    – javanoob
    Commented Oct 30, 2017 at 14:45
  • 1
    Just added an additional way to do it as described in Nathan Totten's blog post :) Commented Feb 5, 2018 at 17:09
  • Is there any possibility we connect scratch org with MavensMate in VS code? Commented Aug 22, 2018 at 5:06
5

If you're looking for auto deploy, you can set this in the workspace settings... To push files each time you save them, set the user or workspace setting

 salesforcedx-vscode-core.push-or-deploy-on-save.enabled:true

Reference to Article

https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/package-development-model

1
  • I upvoted because it does deploy when a file is saved, but only when done via an open folder (project), when "Saving" the same file from within a "Workspace" it does not deploy. Commented Jul 30, 2019 at 1:07
3

This feature has been added in a Feature Preview option to the Salesforce VS-Code extension. Click here for details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .