pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Workspace folder names are evaluated as regular expressions

Open nils-soderman opened this issue 11 months ago • 2 comments

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

  1. Create a VS Code workspace with the settings above.

  2. 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

nils-soderman avatar Mar 15 '24 09:03 nils-soderman

expand var seems not escaping user provided string.

heejaechang avatar Mar 28 '24 17:03 heejaechang

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.

LeeviOlander avatar Apr 05 '24 15:04 LeeviOlander

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!

cwebster-99 avatar Sep 06 '24 21:09 cwebster-99