pylance-release
pylance-release copied to clipboard
Workspace folder names are evaluated as regular expressions
Environment data
- Language Server version: v2024.3.1
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.9.2
Code Snippet
example.code-workspace
{
"folders": [
{
"name": "[ --- Hello World ---- ]",
"path": "."
}
]
}
Repro Steps
-
Create a VS Code workspace with the settings above.
-
Open a python file in the workspace to make sure Pylance extension initialize. Then check the Python Language Server output logs.
Expected behavior
No errors
Actual behavior
All settings are not properly read, and e.g. python.analysis.extraPaths
might not be resolved (sometimes they still get resolved, and sometimes not).
Logs
2024-03-15 10:37:53.582 [info] [Error - 10:37:53 AM] (3596) Error reading settings: SyntaxError: Invalid regular expression: /\$\{workspaceFolder:[ --- Hello World ---- ]\}/g: Range out of order in character class
expand var seems not escaping user provided string.
I have recently encountered this issue on two separate computers, starting sometime in late March. Thus, it is likely that this issue is caused by a relatively recent update.
Thank you for the report! Given our current limited resources, it's unlikely we will be able to fix this issue in the near future. We're closing it so we can focus on higher priority issues. However, if this is a critical issue for you let us know and we can reevaluate. Thanks!