microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 769 forks source link

Consider hiding imported classes and functions in outline view #6257

Closed youralmight closed 22 hours ago

youralmight commented 1 month ago

Today, vscode python displays both imported and here-defined methods and classes in the outline view of an opened python file, which results in long and unintelligible outline content like that in this picture. Screenshot 2024-08-09 112352

In fact, there are only 6 functions defined in the given example and all others are imported. If the imported classes and functions can be hidden, the outline view can be much more clearer and it will help a lot in source code reading. image

debonte commented 1 month ago

@youralmight, your issue got transferred to the Pylance issue tracker, however I suspect that you are using Jedi rather than Pylance. Can you confirm? Do you have python.languageServer set to "Jedi" or set to "Default" but either don't have Pylance installed or have it disabled?

You didn't provide sample code to reproduce what you're seeing, but here's what I see with the following simple example:

from pandas import DataFrame

def foo(): pass

Pylance

image

Jedi

image

github-actions[bot] commented 22 hours ago

This issue has been closed automatically because it needs more information and has not had recent activity. If the issue still persists, please reopen with the information requested. Thanks.