Skip to content

Provide an option to disable specific stubs in settings #840

@southwood

Description

@southwood

This is a great project - very useful and much faster than other language servers.

However, I've noticed that the stubs aren't accurate for a lot of things. I would much rather navigate to the source definitions than see misleading stub interfaces. It's always edge-cases. Most of the stubs are correct. It took me longer than it should have to realize that my local language server had changed, and that pylance was ignoring the actual source files. Reminds me of the early days of tsds and DefinitelyTyped with reverse engineered type definitions.

Please add an exclusion list for stubs so that developers have a way to fall-back to source definitions other than switching the language server.

The best work-around I have found so far is to toggle "justMyCode": false, in the launch config and step-into code where the pylance stubs are misleading. Before VSCode started using pylance it was possible to navigate into the source definition of installed packages. This feature is much more useful than navigating into a stub definition even when the stubs are correct.

As a corollary, I suggest that the stubs not be used at all when viewing the source definition of an inferred function or class. Specifically with the f12 hot-key or right-click navigation of "Go To Definition".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions