enjoy-digital / litex

Build your hardware, easily!
Other
2.92k stars 557 forks source link

litex_setup installs python packages as --editable, breaking VS Code #1977

Open vvuk opened 4 months ago

vvuk commented 4 months ago

The VS Code "pylance" language server cannot find modules installed as editable using the "import finder" executable pth format. Removing the --editable fixes the issue, and litex modules are found in the editor. Is there a reason they are installed editable in non-litex-dev setups? I didn't try to "compat mode" workaround.

Ref: https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#editable-install-modules-not-found

maass-hamburg commented 3 weeks ago

I recommend adding this to your settings.json of your vscode project:

    "python.analysis.extraPaths": [
        "./litex",
        "./migen",
        "./liteeth",
        "./litespi",
        "./litedram"
    ],