-
Notifications
You must be signed in to change notification settings - Fork 29k
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
How can an extension use path variables in a settings string that specifies a path? #5089
Comments
@bpasero I don't think this is about environmental variables (which present a lot more challenges than VSCode built-in paths constants?) |
The environment variable approach could work but wouldn't be ideal. I see that our extension's language host exe inherits the following env vars from VSCode: Now, if VSCode also defined VSCODE_WORKSPACEROOT and VSCODE_EXTENSIONROOT we could make this work. However we would have a user education/usability issue. In some cases (ie launch.json) we tell users to use |
#2809 covers also variables we introduce. |
Steps to Reproduce:
user
level or theworkspace
level (.vscode\settings.json)../ScriptAnalyzerSettings.psd1
would be confusing because the meaning of.
would likely change depending on which setting file is in effect (global, user or workspace).expand
certain variables for us before sending thesettings path
to the extension (either during extension activation or when a user changes a settings file). I would like to see these variables available:${workspaceRoot}
,${extensionRoot}
and perhaps${home}
."${workspaceRoot}\custom-settings.psd1
" get translated to an absolute path by VSCode and that absolute path is then provided to the extension e.g."C:\work\PowerShell\MyNewModule\custom-settings.psd1"
.cc @daviwil
The text was updated successfully, but these errors were encountered: