Open davijonm opened 2 weeks ago
:wave: This seems like the same issue as https://github.com/Shopify/ruby-lsp/issues/1990 which was solved by updating asdf
. What version of asdf
is in use?
Latest version
Thanks. And how was asdf
installed?
In the latest release, we start printing invalid JSON environments to the output tab to make this type of problem easier to diagnose. Could you please give it a try and report what the extension tried to parse as the environment?
here it is:
and the file is there:
Based on what I could gather, it seems that /bin/sh
(the default shell used when calling exec
) doesn't support the [[ ]]
syntax on all operating systems. I assume you're using some other shell in your terminal and not /bin/sh
, otherwise you'd see the problem there as well.
I think we can try to run exec with the shell identified by VS Code, which I'm exploring on this PR https://github.com/Shopify/ruby-lsp/pull/2006.
@davijonm it would be extremely helpful if you could confirm that this fixes the issue. You can do so by following these steps:
cd vscode && yarn install
)Run and debug
panel, select the task Run extension
and click start. This will open a second VS Code window where the development version of the extension is runningOk, did all the steps. In the step 5, it opened a second window with this error bellow:
I use zsh but asdf is set in both .zshrc and .bashrc files
Not sure why it still used /bin/sh
. I pushed https://github.com/Shopify/ruby-lsp/pull/2006 to fallback to process.env.SHELL
and added a print so that we can inspect the values. If you don't mind giving it another try, I'd like to understand if vscode.env.shell
is not set for you.
Here is the result
Hey guys, any updates?
@davijonm we're still investigating. For now, you can downgrade to v0.5.19 of the extension to switch to the older activation approach.
Vscode, asdf and Ruby LSP are all in the latest versions
Code snippet or error message VS code message: Failed to activate asdf environment: Unexpected token '/', "/bin/sh: 2"... is not valid JSON