Skip to content

Feature Request: Outline view should display inherited attributes and highlight overrides #25432

@singularitti

Description

@singularitti

Problem

When opening a Python file in VS Code with the Python extension, the Outline view only shows class members that are explicitly implemented in that file/module.

If a class subclasses from other classes (even if those base classes are defined in the same file), no inherited attributes or methods are displayed. This makes it hard to understand the full API surface of a class at a glance.

Image

Steps to Reproduce

  1. Define a base class with several methods.
  2. Define a subclass in the same file that inherits from the base class but overrides only one method.
  3. Open the file in VS Code and inspect the Outline view.
  4. Only the overridden method appears under the subclass; inherited methods are missing.

Expected Behavior

  • The Outline view should list all attributes/methods visible on the class, not just those defined locally.
  • Explicitly overridden attributes should be visually highlighted (e.g., bold or different color).
  • Purely inherited attributes should still appear but visually de-emphasized (e.g., grayed out).

Why This Matters

  • Helps developers quickly understand a class’s complete interface, especially in multiple-inheritance/ABC scenarios.
  • Makes it easier to identify what’s been overridden and what’s inherited without manually jumping to base classes.
  • Improves readability for large codebases with mixins or framework base classes.

Related Work

  • PyCharm already implements this.
    Image

  • Third-party packages such as rich can also display class APIs with inherited/overridden distinctions.
    Image

  • This seems related to VS Code’s DocumentSymbolProvider for Python, but I could not find any handling of inheritance in the current extension source.

Request

  • Is it feasible to extend the Python extension’s Outline provider to support inherited attributes?
  • Could you consider a design where overridden attributes are highlighted, and inherited attributes are listed but de-emphasized?

Environment

  • VS Code version:
Version: 1.103.2
Commit: 6f17636121051a53c88d3e605c491d22af2ba755
Date: 2025-08-20T16:45:34.255Z
Electron: 37.2.3
ElectronBuildId: 12035395
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Darwin arm64 24.6.0
  • Python extension version: 2025.12.0
  • OS: macOS 15.6.1 (24G90)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions