add DocumentSymbol#detail, #34968

This commit is contained in:
Johannes Rieken
2018-06-13 16:14:15 +02:00
parent a9a919556a
commit ae9063f094
8 changed files with 21 additions and 2 deletions

View File

@@ -379,6 +379,7 @@ export namespace DocumentSymbol {
export function from(info: vscode.DocumentSymbol): modes.DocumentSymbol {
let result: modes.DocumentSymbol = {
name: info.name,
detail: info.detail,
fullRange: Range.from(info.fullRange),
identifierRange: Range.from(info.gotoRange),
kind: SymbolKind.from(info.kind)
@@ -391,6 +392,7 @@ export namespace DocumentSymbol {
export function to(info: modes.DocumentSymbol): vscode.DocumentSymbol {
let result = new types.DocumentSymbol(
info.name,
info.detail,
SymbolKind.to(info.kind),
Range.to(info.fullRange),
Range.to(info.identifierRange),

View File

@@ -883,17 +883,23 @@ export class SymbolInformation {
export class DocumentSymbol {
name: string;
detail: string;
kind: SymbolKind;
fullRange: Range;
gotoRange: Range;
children: DocumentSymbol[];
constructor(name: string, kind: SymbolKind, fullRange: Range, gotoRange: Range) {
constructor(name: string, detail: string, kind: SymbolKind, fullRange: Range, gotoRange: Range) {
this.name = name;
this.detail = detail;
this.kind = kind;
this.fullRange = fullRange;
this.gotoRange = gotoRange;
this.children = [];
if (!this.fullRange.contains(this.gotoRange)) {
throw new Error('gotoRange must be contained in fullRange');
}
}
}