Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3

This commit is contained in:
ADS Merger
2020-03-11 04:19:23 +00:00
parent 16fab722d5
commit 4c3e48773d
880 changed files with 20441 additions and 11232 deletions

View File

@@ -5,7 +5,6 @@
import { Emitter, Event } from 'vs/base/common/event';
import { IDisposable, combinedDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { values } from 'vs/base/common/map';
import { URI } from 'vs/base/common/uri';
import { ICodeEditor, isCodeEditor, isDiffEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';
import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';
@@ -22,7 +21,7 @@ import { MainThreadTextEditors } from 'vs/workbench/api/browser/mainThreadEditor
import { ExtHostContext, ExtHostDocumentsAndEditorsShape, IDocumentsAndEditorsDelta, IExtHostContext, IModelAddedData, ITextEditorAddData, MainContext } from 'vs/workbench/api/common/extHost.protocol';
import { EditorViewColumn, editorGroupToViewColumn } from 'vs/workbench/api/common/shared/editor';
import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor';
import { IEditor as IWorkbenchEditor } from 'vs/workbench/common/editor';
import { IEditorPane } from 'vs/workbench/common/editor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
@@ -110,8 +109,8 @@ class DocumentAndEditorState {
static compute(before: DocumentAndEditorState | undefined, after: DocumentAndEditorState): DocumentAndEditorStateDelta {
if (!before) {
return new DocumentAndEditorStateDelta(
[], values(after.documents),
[], values(after.textEditors),
[], [...after.documents.values()],
[], [...after.textEditors.values()],
undefined, after.activeEditor
);
}
@@ -291,11 +290,11 @@ class MainThreadDocumentAndEditorStateComputer {
}
private _getActiveEditorFromEditorPart(): IEditor | undefined {
let result = this._editorService.activeTextEditorWidget;
if (isDiffEditor(result)) {
result = result.getModifiedEditor();
let activeTextEditorControl = this._editorService.activeTextEditorControl;
if (isDiffEditor(activeTextEditorControl)) {
activeTextEditorControl = activeTextEditorControl.getModifiedEditor();
}
return result;
return activeTextEditorControl;
}
}
@@ -436,17 +435,17 @@ export class MainThreadDocumentsAndEditors {
}
private _findEditorPosition(editor: MainThreadTextEditor): EditorViewColumn | undefined {
for (const workbenchEditor of this._editorService.visibleControls) {
if (editor.matches(workbenchEditor)) {
return editorGroupToViewColumn(this._editorGroupService, workbenchEditor.group);
for (const editorPane of this._editorService.visibleEditorPanes) {
if (editor.matches(editorPane)) {
return editorGroupToViewColumn(this._editorGroupService, editorPane.group);
}
}
return undefined;
}
findTextEditorIdFor(inputEditor: IWorkbenchEditor): string | undefined {
findTextEditorIdFor(editorPane: IEditorPane): string | undefined {
for (const [id, editor] of this._textEditors) {
if (editor.matches(inputEditor)) {
if (editor.matches(editorPane)) {
return id;
}
}