Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode esbonio extension uses deprecated variable ${workspaceRoot} instead of ${workspaceFolder} #404

Closed
davbeek opened this issue Jun 5, 2022 · 5 comments
Labels
bug Something isn't working ide:vscode Issues that relate to the Esbonio vscode extension

Comments

@davbeek
Copy link

davbeek commented Jun 5, 2022

VSCode has deprecated the variable ${workspaceRoot} in favour of ${workspaceFolder} to better align with Multi-root Workspace support, see:

https://code.visualstudio.com/docs/editor/variables-reference#_why-isnt-workspaceroot-documented

The VSCode esbonio extension still uses ${workspaceRoot}, see:

https://swyddfa.github.io/esbonio/docs/latest/en/lsp/getting-started.html?editor=vscode-esbonio#confval-esbonio.server.pythonPath-string

This is confusing, since all VSCode documentation uses ${workspaceFolder} now.

For example, the setting "esbonio.server.pythonPath": "${workspaceFolder}/.venv/bin/python gives an error starting up the esbonio language server. Replacing ${workspaceFolder} by ${workspaceRoot} works. Removing the setting also works.

@alcarney alcarney added bug Something isn't working ide:vscode Issues that relate to the Esbonio vscode extension labels Jun 5, 2022
@alcarney
Copy link
Member

alcarney commented Jun 5, 2022

Ah yes... that's not ideal.

The simplest 'fix' would be to add ${workspaceFolder} as an alias for the existing ${workspaceRoot} logic in the VSCode extension - would that be sufficient for your needs?

I still haven't quite got my head around how ${workspaceFolder} is supposed to work in a multi-root context but hopefully that can wait until #326 is tackled.

@lextm
Copy link
Contributor

lextm commented Jun 6, 2022

${workspaceRoot} is still widely used so it would be too rushed to stop supporting it. Ideally the language server should support both as valid variables in the foreseeable future.

@davbeek
Copy link
Author

davbeek commented Jun 6, 2022

The simplest 'fix' would be to add ${workspaceFolder} as an alias for the existing ${workspaceRoot} logic in the VSCode extension - would that be sufficient for your needs?

Yes, sufficient indeed, although I wonder if and when VSCode could drop support for $(workspaceRoot}. No idea how long they keep supporting deprecated features. Replacing ${workspaceRoot} by ${workspaceFolder} in the extension and adding ${workspaceRoot} as an alias for ${workspaceFolder} would be more work, but would perhaps be a more robust fix.

@alcarney
Copy link
Member

alcarney commented Jun 6, 2022

As far as I know there's no API extensions can rely on for the implementation of variables like ${workspaceRoot} which means we have to implement support for these ourselves.

On the flip side, this means we can support ${workspaceRoot} for as long as it makes sense and there's not much difference between what is an alias for what at the moment 😄

@davbeek
Copy link
Author

davbeek commented Jun 7, 2022

Indeed, I was rather surprised to read that API support for variable resolving is still missing, see:
microsoft/vscode#140056
microsoft/vscode#148514

Then indeed, your straightforward solution would be perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ide:vscode Issues that relate to the Esbonio vscode extension
Projects
None yet
Development

No branches or pull requests

3 participants