Description:
Setting up ballerina.home should be mentioned in the doc

Tried this out and it worked for me without setting up ballerina.home. Did you restart VS Code?
@samgnaniah , it was a warning notification for me to set ballerina home config when I open project folder as below.
If this is working fine without set ballerina.home manually, we can resolve this issue.

(Windows 10 )
Created https://github.com/ballerina-platform/ballerina-www/issues/881 to track this. Hence closing.
@samgnaniah Did not work out for me even after restarting VS Code. How to set ballerina.home ?
Ran into the same problem and I troubleshooted it like this. I use Linux Ubuntu with the default .deb installation of Ballerina.
ballerina bash command lies in /usr/bin/ballerina. However, it is linked to /usr/lib/ballerina/ballerina-XXXX/bin/ballerina bash script (XXXX denotes your ballerina version). Thus, the original script which runs is the latter.
Open that script and see this particular line:
# set BALLERINA_HOME
BALLERINA_HOME=`cd "$PRGDIR/.." ; pwd`
There you have it! Just put up a echo $BALLERINA_HOME in that script (After the
BALLERINA_HOME=`cd "$PRGDIR/.." ; pwd`
command), and run ballerina in your terminal - you'll get the location of ballerina.home inside your terminal (In my case, it is /usr/lib/ballerina/ballerina-0.981.0). Just copy it and paste it in VSCode settings, and restart VSCode.
Thanks @dasunpubudumal
I had that message : The configured "ballerina.home" seems incorrect.
I can confirm the $BALLERINA_HOME is the parent folder of the dereferenced symlink
And it fixes the error
Going further,
For future releases the installer should abstract away the version number with some kind of latest symlink (or similar)
So we won't need to update our vscode settings along with ballerina upgrade...
I tried this pattern manually :
$ ls -la /usr/lib/ballerina/
total 12
drwxr-xr-x 3 root root 4096 Sep 11 23:16 .
drwxr-xr-x 161 root root 4096 Sep 11 22:57 ..
drwxr-xr-x 7 root root 4096 Sep 11 22:57 ballerina-0.981.1
lrwxrwxrwx 1 root root 36 Sep 11 23:16 latest -> /usr/lib/ballerina/ballerina-0.981.1
And updated my settings accordingly :
{
"ballerina.home": "/usr/lib/ballerina/latest"
}
But then got the following error :
Version of ballerina found inside the configured "ballerina.home" does not match with this plugin's version. Some features may not work properly.
The extension should then be updated not to retrieve the ballerina version from its path...
Most helpful comment
Ran into the same problem and I troubleshooted it like this. I use Linux Ubuntu with the default
.debinstallation of Ballerina.ballerinabash command lies in/usr/bin/ballerina. However, it is linked to/usr/lib/ballerina/ballerina-XXXX/bin/ballerinabash script (XXXX denotes your ballerina version). Thus, the original script which runs is the latter.Open that script and see this particular line:
There you have it! Just put up a
echo $BALLERINA_HOMEin that script (After thecommand), and run
ballerinain your terminal - you'll get the location ofballerina.homeinside your terminal (In my case, it is/usr/lib/ballerina/ballerina-0.981.0). Just copy it and paste it in VSCode settings, and restart VSCode.