Skip to content

Visual Studio Code Outline should indicate public, protected, private, and package-private methods when viewing a Java document. #1544

Open

Description

@tommai78101

This is a feature request.

I don't know if this requires upstream support from Visual Studio Code itself. Currently, when viewing the Outline in Visual Studio Code, there are no indications suggesting the methods is public, protected, private, or package-private. In other words, it is difficult to differentiate the method accessors by type just by viewing the Outline. You can see the Visual Studio Code screenshot below, and try to find which one of them is not private:

image

In Eclipse, they have different icon colors to indicate the different method accessors.

image

It would be nice to see them, so it's easier to find and discover which methods are available from the Outline.

Environment
  • Operating System: Ubuntu 18.04.4 LTS
  • JDK version: OpenJavaSDK 1.8 (on maintenance mode at work)
  • Visual Studio Code version: 1.47.2
  • Java extension version: 0.64.1
Current Result

Not easy to differentiate the method's accessor levels (public, protected, private, package-private) in the Outline.

image

Expected Result

Something along the lines of being able to differentiate the methods in the Outline.

image

Activity

  1. akaroml commented on Jul 29, 2020

    @akaroml
    Contributor

    The Outline view visualizes Document Symbols, which do not have accessor info today. For this to happen, vscode needs to change its protocols.

    Instead, you could use the JAVA DEPENDENCIES view provided by Java Dependency Viewer extension.

  2. tommai78101 commented on Jul 29, 2020

    @tommai78101
    Author

    Ok, so it really is an issue that requires upstream support. I'll post there and ask for document symbols protocols support, otherwise it really would be nice to have this. Do you know of any prior issues on Visual Studio Code that is related to this, so I can make sure not to report any duplicates?

    This is the only issue thus far I found to be somewhat relevant:

    microsoft/vscode#97095

  3. sandipchitale commented on May 4, 2021

    @sandipchitale

    Also support static indicator icon.

  4. mitonize commented on Oct 9, 2022

    @mitonize
  5. korolserhii commented on Oct 27, 2026

    @korolserhii

    Until the Outline itself can show modifiers (see above), I made a small extension that does it in a separate panel next to Outline: Java Member Visibility

    Each method and field is marked + public, # protected, ~ package-private or − private, with static / final shown too. First version — feedback welcome.

    Same class in both panels — in Outline you can't tell which members are private, in Java Members you see it at a glance:

    Image
  6. anar-ibragimoff commented on Oct 28, 2026

    @anar-ibragimoff

    8. Until the Outline itself can show modifiers (see above), I made a small extension that does it in a separate panel next to Outline: Java Member Visibility

    Finally someone did it! Love it!

    Note: your github has no public repositories - can't find where to post feature requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions