DetachHead / basedpyright

pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
https://docs.basedpyright.com
Other
1.11k stars 20 forks source link

[Bug] `pythonPath` configuration option not recognized after `basedpyright` update #602

Closed pidgeon777 closed 1 month ago

pidgeon777 commented 2 months ago

After a basedpyright update, I have this error when LSP is started:

unknown config option: pythonPath

My pyrightconfig.json is:

{
  "venvPath": "C:/Users/<USERNAME>/scoop/persist/miniconda3/envs",
  "venv": "common",
  "pythonPath": "C:/Users/<USERNAME>/scoop/apps/miniconda3/current/python.exe",

  "include": [
        "./*" // Includes all files in the root directory and subdirectories
      ],
  "exclude": [
        "**/node_modules", // Commonly excluded in many projects
        "**/__pycache__", // Exclude Python cache directories
        "**/.venv", // Exclude virtual environments
        "**/venv", // Exclude virtual environments
        ".git", // Exclude git directory
        "*/site-packages/" // Exclude site-packages directories if not desired
      ],
}

This configuration was working before the update.

DetachHead commented 2 months ago

i don't think pythonPath was ever a valid option in pyrightconfig.json. it's not present in the configuration docs, only in the language server settings.

the reason you're only now seeing this error is because i made a change recently that reports invalid config as a notification in the language server instead of just silently logging it: #561

i'm pretty sure that means the setting wasn't doing anything and you can probably just remove it from your pyrightconfig.json. it should just automatically detect your python interpreter

DetachHead commented 1 month ago

closing this, let us know if you are still having issues and we can re-open and investigate if needed