Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)

* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973

* disable strict null check
This commit is contained in:
Anthony Dresser
2019-07-15 22:35:46 -07:00
committed by GitHub
parent f720ec642f
commit 0b7e7ddbf9
2406 changed files with 59140 additions and 35464 deletions

View File

@@ -5,7 +5,7 @@
import * as nls from 'vs/nls';
import { onUnexpectedError } from 'vs/base/common/errors';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { dispose, DisposableStore } from 'vs/base/common/lifecycle';
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';
@@ -32,11 +32,11 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
private static readonly ID = 'editor.contrib.referencesController';
private readonly _disposables = new DisposableStore();
private readonly _editor: ICodeEditor;
private _widget: ReferenceWidget | null;
private _model: ReferencesModel | null;
private _requestIdPool = 0;
private _disposables: IDisposable[] = [];
private _ignoreModelChangeEvent = false;
private readonly _referenceSearchVisible: IContextKey<boolean>;
@@ -91,8 +91,8 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
this._referenceSearchVisible.set(true);
// close the widget on model/mode changes
this._disposables.push(this._editor.onDidChangeModelLanguage(() => { this.closeWidget(); }));
this._disposables.push(this._editor.onDidChangeModel(() => {
this._disposables.add(this._editor.onDidChangeModelLanguage(() => { this.closeWidget(); }));
this._disposables.add(this._editor.onDidChangeModel(() => {
if (!this._ignoreModelChangeEvent) {
this.closeWidget();
}
@@ -103,7 +103,7 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
this._widget.setTitle(nls.localize('labelLoading', "Loading..."));
this._widget.show(range);
this._disposables.push(this._widget.onDidClose(() => {
this._disposables.add(this._widget.onDidClose(() => {
modelPromise.cancel();
if (this._widget) {
this._storageService.store(storageKey, JSON.stringify(this._widget.layoutData), StorageScope.GLOBAL);
@@ -112,7 +112,7 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
this.closeWidget();
}));
this._disposables.push(this._widget.onDidSelectReference(event => {
this._disposables.add(this._widget.onDidSelectReference(event => {
let { element, kind } = event;
switch (kind) {
case 'open':
@@ -205,7 +205,7 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
this._widget = null;
}
this._referenceSearchVisible.reset();
this._disposables = dispose(this._disposables);
this._disposables.clear();
if (this._model) {
dispose(this._model);
this._model = null;