Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you configure python outline mode in VS Code to show only classes and methods

The outline mode for python is a little un-useful, because in addition to showing classes and their "member attributes" (the methods), it shows the attributes of methods (and functions) which is just every variable assigned in a method or function. Showing these renders the outline view very verbose and not really much of an outline at all. It also shows all the imports in the module, which again is really not the point of an outline.

Is there any way to configure Python mode in VSCode so that the outline only shows classes, functions and methods?

like image 706
Marvin Avatar asked Oct 02 '19 13:10

Marvin


People also ask

What is the outline mode for Python?

Bookmark this question. Show activity on this post. The outline mode for python is a little un-useful, because in addition to showing classes and their "member attributes" (the methods), it shows the attributes of methods (and functions) which is just every variable assigned in a method or function.

How to run Python script in Visual Studio Code?

Open the visual studio code, click File —> New File menu item, input the below python source code into the new file, and save it to a local file (test.py) with .py extension. Right-click the above file content in visual studio code, click the Run Current File in Interactive Window menu item in the popup menu list to run the python script.

Is there a way to filter outline view in VS Code?

VS Code 1.40 adds the ability to filter the Outline view. Search for settings like "outline.showVariables" to see all the options. Show activity on this post. There does not seem to be. The ms-python.python extension could provide a feature to control how the outline is displayed by the outline in vscode. It does not currently do so.

How to configure Python environment in Visual Studio Code?

1. How To Configure Python Environment In Visual Studio Code. Open visual studio code and click the extensions option on the left bottom of the main interface. You can also click the View —> Extensions menu item at the top of the visual studio code to open the extensions option panel.


1 Answers

VS Code 1.40 adds the ability to filter the Outline view. Search for settings like "outline.showVariables" to see all the options.

like image 87
Brett Cannon Avatar answered Oct 31 '22 09:10

Brett Cannon