microsoft / pyright

Static Type Checker for Python
Other
13.18k stars 1.41k forks source link

Ability to remove python's dunder functions from the code completion list (pyright's intellisense) #1090

Closed WillAvudim closed 3 years ago

WillAvudim commented 3 years ago

The code completion list for every python object contains the standard set of python functions, such as __add__, __annotations__, __class__, __eq__, __hash__, __init__, ... Trust me, it's a very long list - https://docs.python.org/3/library/operator.html

The fun part is that sometimes my class' fields and methods are intermingled with the dunder functions, which makes it a long quest to look through.

Would it be possible to introduce an option to delist all members starting with 2 underscores ("dunder" functions and private functions)?

I have also noticed that the debug console's representation of python objects neatly hides them inside the "special variables" list. Thank you for doing that, that is awesome!

erictraut commented 3 years ago

I'm going to move this request to the pylance repo since it's related to language service features rather than core type checking.