Recently I have started working on VSCode for my Salesforce development. Earlier I was leveraging the Illuminated Cloud plugin of Webstorm for all my development activities.
So in Webstorm, there is a Structure window using which you can examine the structure of the file currently opened in the editor, be it an Apex class or trigger, Visualforce or Lightning markup file, or JavaScript, CSS, or XML metadata file. It was also easy to navigate between related files of a Lightning component without using the file or project explorer, whatever you say.
VSCode has a navigation bar above its contents known as Breadcrumbs. It shows the current location and allows you to quickly navigate between symbols and files. By default, this is disabled. To start using breadcrumbs, enable it with the View > Toggle Breadcrumbs command or via the breadcrumbs.enabled setting like below:
"breadcrumbs.enabled": true
Once enabled, you will be able to see a navigation bar. So if you check the image below, on clicking the name of the file on navigation bar, you will be able to see the related files of that Lightning component.
Similarly, you can examine the structure of the file currently in focus as below:
For code reformatting, Prettier works like a charm for JS files. But I hope that in the near future, Salesforce add code reformatting capability for Apex files. As of now, there is a plugin Uncrustify which can be used to format Apex files. You can setup this plugin with VSCode, the instructions of which can be found in the link below:
https://salesforce.stackexchange.com/questions/212382/format-apex-code-visual-studio-code
0 comments:
Post a Comment