pythonvisual-studio-code

How can you configure Python outline mode in Visual Studio 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 a way to configure Python mode in Visual Studio Code, so that the outline only shows classes, functions and methods?


Solution

  • Visual Studio Code 1.40 (October 2019) adds the ability to filter the Outline view. Search for settings like "outline.showVariables" to see all the options.