Coc.nvim: Coc.nvim Support for Salesforce Development Tools

Created on 3 Feb 2020  路  4Comments  路  Source: neoclide/coc.nvim

Is your feature request related to a problem? Please describe.
No. Extensions for Salesforce would be a great addition. I have been developing for a Salesforce application for about a year now in Vim and it's not the best experience within Vim. I would like to propose extensions to make Vim a great IDE for Salesforce development borrowing from what the Salesforce team has already done in creating extensions for vscode.

Describe the solution you'd like
A coc.nvim extension(s) for Salesforce development tools such as Lightning Framework(LWC & Aura), Apex.

Describe alternatives you've considered
Currently, I have to set up the provided language server from Salesforce for the Apex side of it, with coc.nvim's languageservers. It works, at least for things like Go to Definition and Autocomplete, but I figure out that I'd need to manually do that for each of the other Salesforce tools, and a fully-fledged coc.nvim extension would be more robust borrowing from the vs-code extensions.

Additional context
The Salesforce team has already developed these plugins for vscode which can be borrowed for Vim as well.

help wanted

Most helpful comment

So far so good, I have managed to achieve quite a very blissful experience on NeoVim when working with Salesforce.

Anyone who'd like to benefit from my work so far can have a look at my vim repo here.

For this purpose, you would be interested in the salesforce-language-servers directory.

  • Change into that directory and install node dependencies (You may want to do that occassionally to keep up to date with the latest updates from the Salesforce team)
  • Change back to the root directory of the repo and create a symbolic link for the Salesforce language servers. I use:

    • ln -s $(pwd)/salesforce-language-servers/ ~/.config/nvim/salesforce-language-servers

  • To link the services to Coc.nvim, check out my coc-settings.json for the rules for apexcode, aura and lwc. NB:

    • You will need to tweak the paths as they contain my username

    • Apex language servers need you to have Java SDK 11 installed and referenced properly in coc-settings.json

    • For aura and lwc ensure that the filetype for your markup files is html

What you'll get

Most of what is in VScode except for commands. One very useful command is Refresh SObject Definitions. When I know that there are definitions changes in SObjects, I will use VScode to pull the new definitions, and all will be well in NeoVim when that long-running process is done; I am yet to work around that inside NeoVim. I don't care about having almost all of the other CLI commands inside my IDE as I have FZF that makes it so easy for me to work with command-line histories.

All 4 comments

Which options do we have here for coc.nvim? I could chip in provided some guidance. @fannheyward

A big problem is we don't have debug support for now.

So far so good, I have managed to achieve quite a very blissful experience on NeoVim when working with Salesforce.

Anyone who'd like to benefit from my work so far can have a look at my vim repo here.

For this purpose, you would be interested in the salesforce-language-servers directory.

  • Change into that directory and install node dependencies (You may want to do that occassionally to keep up to date with the latest updates from the Salesforce team)
  • Change back to the root directory of the repo and create a symbolic link for the Salesforce language servers. I use:

    • ln -s $(pwd)/salesforce-language-servers/ ~/.config/nvim/salesforce-language-servers

  • To link the services to Coc.nvim, check out my coc-settings.json for the rules for apexcode, aura and lwc. NB:

    • You will need to tweak the paths as they contain my username

    • Apex language servers need you to have Java SDK 11 installed and referenced properly in coc-settings.json

    • For aura and lwc ensure that the filetype for your markup files is html

What you'll get

Most of what is in VScode except for commands. One very useful command is Refresh SObject Definitions. When I know that there are definitions changes in SObjects, I will use VScode to pull the new definitions, and all will be well in NeoVim when that long-running process is done; I am yet to work around that inside NeoVim. I don't care about having almost all of the other CLI commands inside my IDE as I have FZF that makes it so easy for me to work with command-line histories.

I have composed these extension for Salesforce development:

馃コ 馃嵕

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hackingcat picture hackingcat  路  3Comments

tom-james-watson picture tom-james-watson  路  3Comments

MacGuffinLife picture MacGuffinLife  路  4Comments

andys8 picture andys8  路  3Comments

czepluch picture czepluch  路  3Comments