Skip to content

Add visibility to SymbolInformation #98

Description

I propose an addition to SymbolInformation that allows an LS to report the visibility (private, protected, public) to the client:

interface SymbolInformation {
  visibility?: Visibility;
}
enum Visibility {
  Private = 1,
  Protected = 2,
  Public = 3
}

A client can choose how he uses that information:

  • it could display an icon that indicates a symbol is private
  • after getting a list of symbols, it could allow the user to hide/show only public symbols

The same property could get added to CompletionItem.

I think private, protected and public should cover all languages, or are there more modifiers in some languages?

The enum should be structured to allow something like

if (symbol.visibility >= Visibility.Protected) {
  // symbol is at least protected or public
}

Activity

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions