-
Notifications
You must be signed in to change notification settings - Fork 133
${workspaceFolder} in extraPaths resolved unexpectedly #1974
Comments
I'm pretty sure we don't support the Does |
Alright, thanks. A simple relative path works as expected. The use of |
This may have worked in the past because we didn't allow the paths to be changed at runtime, and the extension would pass them directly at startup (so would do a "lookup" through its settings provider which would have handled the replacement). But in #1492, I changed to no longer needing that constraint and instead using the LSP to ask the client for the config. The variables are implemented by the extension as documented here: https://code.visualstudio.com/docs/python/settings-reference#_predefined-variables But, LSP is generally between the editor and the server without the extension in the middle (who was the one who created the variables), unless it opts to intercept and start replacing. I'm not sure where exactly we'd want to modify things. The LS is supposed to be agnostic, but the variables are vscode-python specific. The immediate solution that comes to mind is to have the extension intercept all configuration messages and forcing a replacement, but that's pretty iffy. |
Just remembered #1783. |
Per |
I'd like to at least leave #1783 open; it's possible we'll want to handle these cases for the extension (and have some initialization option in the future to indicate we should do replacements). |
Environment data
Expected behaviour
The variable
${workspaceFolder}
within the setting"python.autoComplete.extraPaths"
is resolved to the correct workspace folder. For a project folderC:/temp/myproject
,${workspaceFolder}/sublibs
should be resolved toC:/temp/myproject/sublibs
and${workspaceFolder}/../sublibs
should be resolved toC:/temp/sublibs
.Actual behaviour
The settings
lead to missing auto complete for
sublibs
, the user search path in the output isThe settings
"fix" the problem, the user search path in the output is
However, the expected path is
C:\temp\sublibs
.Additional lnformation
Apparently, to get the correct workspace folder, I need to write
${workspaceFolder}/../
. If${workspaceFolder}
is not followed by..
, it is not resolved at all.Of course, there is the workaround to use relative paths instead of this variable.
The text was updated successfully, but these errors were encountered: