basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

implementation files from the standard library are not found by the language server when `venv` and `venvPath` are set

Open DetachHead opened this issue 1 year ago • 2 comments

[tool.basedpyright]
venvPath = "."
venv = ".venv"
from dataclasses import dataclass

when these options set, "go to definition" (not to be confused with declaration) will only go to dataclasses.pyi instead of dataclasses.py, and its docstring is not visible because it comes from the implementation

my guess is that these options prevent it from looking outside of the venv, but standard library source files do not get copied into the venv

DetachHead avatar Aug 13 '24 06:08 DetachHead

venvPath/venv is now discouraged in favor of pythonPath so i'm going to leave these options as-is. see https://docs.basedpyright.com/dev/benefits-over-pyright/better-defaults/#default-value-for-pythonpath

if anybody still feels a need for these settings feel free to raise a separate issue

DetachHead avatar Jan 25 '25 03:01 DetachHead

re-opening to re-consider this after discussion on #1248

DetachHead avatar Apr 23 '25 12:04 DetachHead