mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
add DocumentSymbol#detail, #34968
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user