Skip to content

Commit

Permalink
support containerName in workspace/symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince781 committed Jul 9, 2021
1 parent 878c2b9 commit cb85813
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/protocol.vala
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,16 @@ namespace Lsp {
}
public Range selectionRange { get; set; }
public Gee.List<DocumentSymbol> children { get; private set; default = new Gee.LinkedList<DocumentSymbol> (); }
public string? parent_name;

private DocumentSymbol () {}

/**
* @param type the data type containing this symbol, if there was one (not available for Namespaces, for example)
* @param sym the symbol
*/
public DocumentSymbol.from_vala_symbol (Vala.DataType? type, Vala.Symbol sym, SymbolKind kind) {
this.parent_name = sym.parent_symbol != null ? sym.parent_symbol.name : null;
this._initial_range = new Range.from_sourceref (sym.source_reference);
if (sym is Vala.Subroutine) {
var sub = (Vala.Subroutine) sym;
Expand Down Expand Up @@ -350,6 +354,7 @@ namespace Lsp {
this.name = dsym.name;
this.kind = dsym.kind;
this.location = new Location (uri, dsym.range);
this.containerName = dsym.parent_name;
}
}

Expand Down

0 comments on commit cb85813

Please sign in to comment.