How To Create Symlink For Sublime Text and Visual Studio Code in a Mac

This tip is for creating symlink for your favorite text editor, it is like an alias but more powerful. This would allow you to launch the application from the command line. ( You can do the same by setting paths as an alternative to symlinks). Symlinks can only be created from the terminal.

First find out the bin executable directory for the application. Then for the location where the symlink is to be created – /usr/local/bin/

The following command allows you to create symlink for Sublime Text

sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

Then to launch it from the terminal simply type : subl

The following command allows you to create symlink for Visual Studio Code

sudo ln -s "Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" /usr/local/bin/code

Then to launch it from the terminal simply type : code

How To Enable SObject Intellisense in VSCode for Salesforce DX

Quick Tip.

Salesforce DX already comes with Intellisense for Apex classes and the different primitive types. Eg. Strings

For SObjects it’s a per-project setting you need to enable once you have your project created. Open the Command Palette and choose SFDX: Refresh SObject Definitions

What the command does under the hood is it will create a class definition of the SObject and store them under the .sfdx folder/tools folder. These don’t get committed to version control as the .sfdx folder is by default ignored.

Each class has properties that allows the Intellisense to work.

Once enabled you are good to go.

If you want more tips and information on Salesforce DX checkout my youtube playlist where I cover them in detail.

Enable Auto Push or Auto Deploy With Salesforce DX on VSCode

The title says it all if you have been developing before on Force.com IDE/ Mavenmate/IntelliJ and started using Salesforce DX. One that gets pretty tedious fast is manually pushing your code to your scratch org or deploying to your non-tracked org(DE/Sandbox).

To enable auto push/deploy simply edit the .vscode/settings.json. This folder can be hidden on Windows or Mac. On a Mac open the Finder and hit CMD+Shift dot(.) to display hidden files.

Add the following settings and set it to true.

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

My settings.json looks like below.

Another method to do this same steps is to go to the Code menu and choose Preferences then Settings.

Next click on Workspace tab then search for Salesforce

Under Salesforce Feature Previews(3rd one), tick the box under Salesforcedx-vscode-core › Push-or-deploy-on-save: Enabled

This is particularly useful specially for cloned repository where the .vscode folder is not part of the repository.

Don’t forget to update the .gitignore file if you are using version control and add the .vscode folder.

Happy coding!

Word Wrap on Eclipse

Over the past few months I’ve changed my working environment(IDE) for PHP from Dreamweaver, which I have been using for the last past years with occasional use of PHP Designer 2007, 2008. It did the work but I wanted more features and tools. Then I switched to ZendStudio built on Eclipse. It was complete and powerful but I find it not close to the Eclipse IDE which I loved on Flex Builder 3 built on Eclipse. So that ended me up in using a more familiar IDE which is Eclipse PDT for PHP.

So far it has been working great and I have all the tools I need. Just one feature missing though is the word wrapping which I rely cause its just a hassle to scroll sideways just to view the codes. Fortunately there is a workaround to this missing functionality.

Found this alpha plugin if you are interested with getting this feature on Eclipse.

word_wrap

http://ahtik.com/blog/2006/06/18/first-alpha-of-eclipse-word-wrap-released/