From 7753381eb67838b6723824d04af4a5ad4e282220 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 18 Jun 2018 15:46:04 +0200 Subject: [PATCH] renames: range/selectionRange #34968 --- src/vs/editor/common/modes.ts | 4 ++-- .../editor/contrib/documentSymbols/outlineModel.ts | 10 +++++----- .../editor/contrib/documentSymbols/outlineTree.ts | 2 +- .../documentSymbols/test/outlineModel.test.ts | 4 ++-- src/vs/editor/contrib/quickOpen/quickOpen.ts | 6 +++--- .../standalone/browser/quickOpen/quickOutline.ts | 2 +- src/vs/monaco.d.ts | 4 ++-- src/vs/vscode.proposed.d.ts | 14 +++++++------- .../workbench/api/node/extHostLanguageFeatures.ts | 6 +++--- src/vs/workbench/api/node/extHostTypeConverters.ts | 8 ++++---- src/vs/workbench/api/node/extHostTypes.ts | 14 +++++++------- .../parts/outline/electron-browser/outlinePanel.ts | 2 +- .../parts/quickopen/browser/gotoSymbolHandler.ts | 2 +- .../api/extHostLanguageFeatures.test.ts | 2 +- 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 6f2066a45ce7f..b85d9a1053057 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -648,8 +648,8 @@ export interface DocumentSymbol { detail: string; kind: SymbolKind; containerName?: string; - fullRange: IRange; - identifierRange: IRange; + range: IRange; + selectionRange: IRange; children?: DocumentSymbol[]; } diff --git a/src/vs/editor/contrib/documentSymbols/outlineModel.ts b/src/vs/editor/contrib/documentSymbols/outlineModel.ts index 92e2bea37b659..3078407b5a9f3 100644 --- a/src/vs/editor/contrib/documentSymbols/outlineModel.ts +++ b/src/vs/editor/contrib/documentSymbols/outlineModel.ts @@ -32,7 +32,7 @@ export abstract class TreeElement { } else { candidateId = `${container.id}/${candidate.name}`; if (container.children[candidateId] !== void 0) { - candidateId = `${container.id}/${candidate.name}_${candidate.fullRange.startLineNumber}_${candidate.fullRange.startColumn}`; + candidateId = `${container.id}/${candidate.name}_${candidate.range.startLineNumber}_${candidate.range.startColumn}`; } } @@ -131,7 +131,7 @@ export class OutlineGroup extends TreeElement { private _getItemEnclosingPosition(position: IPosition, children: { [id: string]: OutlineElement }): OutlineElement { for (let key in children) { let item = children[key]; - if (!Range.containsPosition(item.symbol.fullRange, position)) { + if (!Range.containsPosition(item.symbol.range, position)) { continue; } return this._getItemEnclosingPosition(position, item.children) || item; @@ -150,11 +150,11 @@ export class OutlineGroup extends TreeElement { item.marker = undefined; // find the proper start index to check for item/marker overlap. - let idx = binarySearch(markers, item.symbol.fullRange, Range.compareRangesUsingStarts); + let idx = binarySearch(markers, item.symbol.range, Range.compareRangesUsingStarts); let start: number; if (idx < 0) { start = ~idx; - if (start > 0 && Range.areIntersecting(markers[start - 1], item.symbol.fullRange)) { + if (start > 0 && Range.areIntersecting(markers[start - 1], item.symbol.range)) { start -= 1; } } else { @@ -164,7 +164,7 @@ export class OutlineGroup extends TreeElement { let myMarkers: IMarker[] = []; let myTopSev: MarkerSeverity; - while (start < markers.length && Range.areIntersecting(markers[start], item.symbol.fullRange)) { + while (start < markers.length && Range.areIntersecting(markers[start], item.symbol.range)) { // remove markers intersecting with this outline element // and store them in a 'private' array. let marker = markers.splice(start, 1)[0]; diff --git a/src/vs/editor/contrib/documentSymbols/outlineTree.ts b/src/vs/editor/contrib/documentSymbols/outlineTree.ts index b34dcd8dfeffc..a38dcf406aaf5 100644 --- a/src/vs/editor/contrib/documentSymbols/outlineTree.ts +++ b/src/vs/editor/contrib/documentSymbols/outlineTree.ts @@ -49,7 +49,7 @@ export class OutlineItemComparator implements ISorter { return a.symbol.name.localeCompare(b.symbol.name); case OutlineItemCompareType.ByPosition: default: - return Range.compareRangesUsingStarts(a.symbol.fullRange, b.symbol.fullRange); + return Range.compareRangesUsingStarts(a.symbol.range, b.symbol.range); } } diff --git a/src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts b/src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts index 5bb3a65f5ccf1..261707d44305e 100644 --- a/src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts +++ b/src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts @@ -75,8 +75,8 @@ suite('OutlineModel', function () { name, detail: 'fake', kind: SymbolKind.Boolean, - identifierRange: range, - fullRange: range + selectionRange: range, + range: range }; } diff --git a/src/vs/editor/contrib/quickOpen/quickOpen.ts b/src/vs/editor/contrib/quickOpen/quickOpen.ts index 32bc5aa628051..ea2c6a13eb74f 100644 --- a/src/vs/editor/contrib/quickOpen/quickOpen.ts +++ b/src/vs/editor/contrib/quickOpen/quickOpen.ts @@ -39,7 +39,7 @@ export function getDocumentSymbols(model: ITextModel): TPromise { let input = this._editorService.createInput({ resource: model.textModel.uri }); - await this._editorService.openEditor(input, { preserveFocus: !focus, selection: Range.collapseToStart(element.symbol.identifierRange), revealInCenterIfOutsideViewport: true, forceOpen: true }, aside ? SIDE_GROUP : ACTIVE_GROUP); + await this._editorService.openEditor(input, { preserveFocus: !focus, selection: Range.collapseToStart(element.symbol.selectionRange), revealInCenterIfOutsideViewport: true, forceOpen: true }, aside ? SIDE_GROUP : ACTIVE_GROUP); } private async _revealEditorSelection(model: OutlineModel, selection: Selection): TPromise { diff --git a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts index 0587d7031665f..2b3c830602adb 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts @@ -450,7 +450,7 @@ export class GotoSymbolHandler extends QuickOpenHandler { // Add results.push(new SymbolEntry(i, label, icon, description, icon, - element.fullRange, null, this.editorService, this + element.range, null, this.editorService, this )); } diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index be85d29b38e5b..201206f9c0dd2 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -182,7 +182,7 @@ suite('ExtHostLanguageFeatures', function () { let entry = value[0]; assert.equal(entry.name, 'test'); - assert.deepEqual(entry.fullRange, { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 }); + assert.deepEqual(entry.range, { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 }); }); }); });