Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -2,17 +2,15 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vs/nls';
import { onUnexpectedError } from 'vs/base/common/errors';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { TPromise } from 'vs/base/common/winjs.base';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ReferencesModel } from './referencesModel';
@@ -27,7 +25,7 @@ export const ctxReferenceSearchVisible = new RawContextKey<boolean>('referenceSe
export interface RequestOptions {
getMetaTitle(model: ReferencesModel): string;
onGoto?: (reference: Location) => TPromise<any>;
onGoto?: (reference: Location) => Thenable<any>;
}
export abstract class ReferencesController implements editorCommon.IEditorContribution {
@@ -97,14 +95,14 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
}
}));
const storageKey = 'peekViewLayout';
const data = <LayoutData>JSON.parse(this._storageService.get(storageKey, undefined, '{}'));
const data = <LayoutData>JSON.parse(this._storageService.get(storageKey, StorageScope.GLOBAL, '{}'));
this._widget = this._instantiationService.createInstance(ReferenceWidget, this._editor, this._defaultTreeKeyboardSupport, data);
this._widget.setTitle(nls.localize('labelLoading', "Loading..."));
this._widget.show(range);
this._disposables.push(this._widget.onDidClose(() => {
modelPromise.cancel();
this._storageService.store(storageKey, JSON.stringify(this._widget.layoutData));
this._storageService.store(storageKey, JSON.stringify(this._widget.layoutData), StorageScope.GLOBAL);
this._widget = null;
this.closeWidget();
}));
@@ -194,7 +192,7 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
this._requestIdPool += 1; // Cancel pending requests
}
private _gotoReference(ref: Location): TPromise<any> {
private _gotoReference(ref: Location): Thenable<any> {
this._widget.hide();
this._ignoreModelChangeEvent = true;
@@ -228,15 +226,15 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
}
public openReference(ref: Location, sideBySide: boolean): void {
// clear stage
if (!sideBySide) {
this.closeWidget();
}
const { uri, range } = ref;
this._editorService.openCodeEditor({
resource: uri,
options: { selection: range }
}, this._editor, sideBySide);
// clear stage
if (!sideBySide) {
this.closeWidget();
}
}
}