mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
renames: range/selectionRange #34968
This commit is contained in:
@@ -69,8 +69,8 @@ class OutlineAdapter {
|
||||
name: info[i].name,
|
||||
kind: typeConvert.SymbolKind.from(info[i].kind),
|
||||
containerName: info[i].containerName,
|
||||
fullRange: typeConvert.Range.from(info[i].location.range),
|
||||
identifierRange: typeConvert.Range.from(info[i].location.range),
|
||||
range: typeConvert.Range.from(info[i].location.range),
|
||||
selectionRange: typeConvert.Range.from(info[i].location.range),
|
||||
children: []
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ class OutlineAdapter {
|
||||
break;
|
||||
}
|
||||
let parent = parentStack[parentStack.length - 1];
|
||||
if (EditorRange.containsRange(parent.fullRange, element.fullRange) && !EditorRange.equalsRange(parent.fullRange, element.fullRange)) {
|
||||
if (EditorRange.containsRange(parent.range, element.range) && !EditorRange.equalsRange(parent.range, element.range)) {
|
||||
parent.children.push(element);
|
||||
parentStack.push(element);
|
||||
break;
|
||||
|
||||
@@ -374,8 +374,8 @@ export namespace DocumentSymbol {
|
||||
let result: modes.DocumentSymbol = {
|
||||
name: info.name,
|
||||
detail: info.detail,
|
||||
fullRange: Range.from(info.fullRange),
|
||||
identifierRange: Range.from(info.gotoRange),
|
||||
range: Range.from(info.range),
|
||||
selectionRange: Range.from(info.selectionRange),
|
||||
kind: SymbolKind.from(info.kind)
|
||||
};
|
||||
if (info.children) {
|
||||
@@ -388,8 +388,8 @@ export namespace DocumentSymbol {
|
||||
info.name,
|
||||
info.detail,
|
||||
SymbolKind.to(info.kind),
|
||||
Range.to(info.fullRange),
|
||||
Range.to(info.identifierRange),
|
||||
Range.to(info.range),
|
||||
Range.to(info.selectionRange),
|
||||
);
|
||||
if (info.children) {
|
||||
result.children = info.children.map(to) as any;
|
||||
|
||||
@@ -885,20 +885,20 @@ export class DocumentSymbol {
|
||||
name: string;
|
||||
detail: string;
|
||||
kind: SymbolKind;
|
||||
fullRange: Range;
|
||||
gotoRange: Range;
|
||||
range: Range;
|
||||
selectionRange: Range;
|
||||
children: DocumentSymbol[];
|
||||
|
||||
constructor(name: string, detail: string, kind: SymbolKind, fullRange: Range, gotoRange: Range) {
|
||||
constructor(name: string, detail: string, kind: SymbolKind, range: Range, selectionRange: Range) {
|
||||
this.name = name;
|
||||
this.detail = detail;
|
||||
this.kind = kind;
|
||||
this.fullRange = fullRange;
|
||||
this.gotoRange = gotoRange;
|
||||
this.range = range;
|
||||
this.selectionRange = selectionRange;
|
||||
this.children = [];
|
||||
|
||||
if (!this.fullRange.contains(this.gotoRange)) {
|
||||
throw new Error('gotoRange must be contained in fullRange');
|
||||
if (!this.range.contains(this.selectionRange)) {
|
||||
throw new Error('selectionRange must be contained in fullRange');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user