Language-server-protocol: Workspace Hierarchy Request

Created on 26 Nov 2016  路  6Comments  路  Source: microsoft/language-server-protocol

It is important for object oriented languages to retrieve the inheritance information. I would like to discuss a new request for retrieving hierarchy of a given Symbol.

feature-request new request

All 6 comments

Some food for thought: Many languages have a fully qualified structural element name for every symbol. Using such a unique identifier, you could represent the tree like this:

interface SymbolInformation {

  // other properties...

  /** fully qualified structural element name (must be unique) */
  id?: string;

  /** an array of symbol FQSENs that this symbol is a child of in a class hierachy */
  extends?: string[];
}

You would then get the hierarchy from workspace/symbol or textDocument/documentSymbol or any method that returns SymbolInformation.

Whether it extends or implements is inferred from the SymbolKind of the parent since languages like C++ don't have separate keywords for that

I agree that a hierarchy request is desirable. We could add this without breaking clients since clients that can't render this will not request it.

@felixfbecker if we go by the example of Java, fqn's are not unique, neither at development time (check out multiple versions of the same class) nor at runtime (load different versions of the same class twice, in different class loaders).
I belive we need something like extends: SymbolInformation [];
Also, what about subtype hierarchy?

I worked on contributing proposed protocol more easily. A document describing this is here: https://github.com/Microsoft/language-server-protocol/blob/master/contributing.md

May be someone wants to look into this.

I added my comments in Microsoft/vscode-languageserver-node#346 since it contains a concrete proposal.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lanza picture lanza  路  6Comments

angelozerr picture angelozerr  路  6Comments

andfoy picture andfoy  路  6Comments

Razzeee picture Razzeee  路  4Comments

ooxi picture ooxi  路  3Comments