2

Have installed latest (as of 28/2/21) versions of ballerina (swan lake alpha2) and VSCode plugin (1.2.13). When I look at a .bal src file the 'language intelligence' seems to work correctly but the 'show file overview reports errors. The errors I get are:

Ballerina extension did not start properly. Please check extension logs for more info.

And logs:

Ballerina home is configured in settings. Configured Ballerina home is not valid. Failed to activate Ballerina extension. Configured Ballerina home is not valid.

I must be missing something with the setting but cannot identify what. Two obvious settings I have tried are:

c:\program files\ballerina\bin & c:\program files\ballerina

Thanks for any guidance

Nadeeshaan
  • 356
  • 5
  • 15
TimH
  • 21
  • 2

2 Answers2

3

The VSCode plugin version 1.2.13 is incompatible with swan lake alpha2. You have to download and install the compatible VSCode extention version available at Swan Lake Alpha2 section in download page. You can find that at the bottom of that section.

Direct Link: https://github.com/ballerina-platform/plugin-vscode/releases/download/vswan-lake-alpha2/ballerina-swan-lake-alpha2.vsix

Once downloaded, you have to install that extension using the Install from VSIX option (In the hamburger menu of the extensions tab).

Update

Ballerina VSCode plugin compatible with Swan Lake is now available in visual studio marketplace

Imesha Sudasingha
  • 3,462
  • 1
  • 23
  • 34
  • Thanks for that - moved forward but now getting the following: Ballerina home is configured in settings. Failed to activate Ballerina extension. Error when checking ballerina version. AggregateError: All promises were rejected – TimH Mar 02 '21 at 19:27
  • In VSCode, can you check the extension settings; `File -> Preferences -> Settings`, in that go to `Extensions -> Ballerina` and check if `Home` is set to some directory. If yes, clear that. You can also try uninstalling the extension (both new and old) and reinstalling again. Let me know the progress. – Imesha Sudasingha Mar 03 '21 at 04:15
  • Also, check if `Dev Mode` is disabled under `Ballerina Plugin` settings (same place as where we had `Home`) – Imesha Sudasingha Mar 03 '21 at 04:26
  • Hi Imesha - thanks for your help - still giving the error - have tried with & without home set, uninstalled & reinstalled and disabled dev mode all to no avail :(. Just one point of clarity - in your first response yesterday you said uninstall the extension (both old and new) & reinstall. Do you mean I should have both old and new installed? I assume not? – TimH Mar 03 '21 at 18:02
  • At a given time, we will have one version installed. In this case, we need the swan lake alpha version's plugin installed. Can you check if `bal` command is working in your terminal? Try `bal version`. – Imesha Sudasingha Mar 03 '21 at 19:10
  • Hi - A couple of things - I need to go to c:\balleina\bin to run bal, also get a warning about not being a path PS loads from and to use .\bal version. Then I get the following: The system cannot find the file C:\Users\tim. Ballerina Swan Lake Alpha 2 Language specification v2020-12-17 Update Tool 0.8.20 – TimH Mar 03 '21 at 19:43
  • In that case, you don't have `ballerina/bin` directory in `path` environment variable. Usually the VSCode plugin picks the `bal` command from PATH. In your case, you have to set the `Home` under ballerina extension settings and then enable `Dev Mode`. This is because you don't have the `bal` command available via `PATH` environment variable. – Imesha Sudasingha Mar 04 '21 at 05:41
  • Thanks for your help, the variable %Ballerina_Home% was set to the right path the in the path it was set to %Ballerina_Home%\bin. sorting that and un ticking dev mode and removing the ballerina settings and the plugin seems to load - but still there is no option to show graphical view. – TimH Mar 04 '21 at 17:00
  • @TimH Happy to hear you got that working. Regarding the graphical view, it is not yet included in `swan lake alpha 2` which is the latest release. The plan is to add that in `swan lake beta` onward. – Imesha Sudasingha Mar 05 '21 at 03:37
  • Ok - thanks for the info - looking forward to the beta release. Thanks so much for your help. – TimH Mar 05 '21 at 17:09
  • Great! No problem! – Imesha Sudasingha Mar 05 '21 at 18:17
  • I'm having the same problem in Ubuntu 20.04 for `swan-lake-beta1`. `bal` command is working from the terminal but I need sudo permissions for that. Can this be the problem? – RrR- Jun 30 '21 at 11:03
0

After installing the extension as described by @Imesha you should add the ballerina home to the PATH. On Mac

vi .zshrc

export PATH="$PATH:/usr/local/Cellar/ballerina/1.2.13/libexec/bin/
Abderrazzak Nejeoui
  • 1,496
  • 12
  • 9