Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const apiTestContentProvider: vscode.NotebookContentProvider = {
assert.strictEqual(firstNotebookEditor?.notebook, secondNotebookEditor?.notebook, 'split notebook editors share the same document');
});

test.skip('#106657. Opening a notebook from markers view is broken ', async function () {
test('#106657. Opening a notebook from markers view is broken ', async function () {

const document = await openRandomNotebookDocument();
const [cell] = document.getCells();
Expand Down
4 changes: 4 additions & 0 deletions src/vs/editor/browser/editorBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,10 @@ export function getCodeEditor(thing: unknown): ICodeEditor | null {
return thing.getModifiedEditor();
}

if (isCompositeEditor(thing) && isCodeEditor(thing.activeCodeEditor)) {
return thing.activeCodeEditor;
}
Comment thread
jrieken marked this conversation as resolved.

return null;
}

Expand Down
13 changes: 8 additions & 5 deletions src/vs/workbench/api/browser/mainThreadEditors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ISelection } from 'vs/editor/common/core/selection';
import { IDecorationOptions, IDecorationRenderOptions } from 'vs/editor/common/editorCommon';
import { ISingleEditOperation } from 'vs/editor/common/core/editOperation';
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { ITextEditorOptions, IResourceEditorInput, EditorActivation } from 'vs/platform/editor/common/editor';
import { ITextEditorOptions, IResourceEditorInput, EditorActivation, EditorResolution } from 'vs/platform/editor/common/editor';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { MainThreadTextEditor } from 'vs/workbench/api/browser/mainThreadEditor';
import { ExtHostContext, ExtHostEditorsShape, IApplyEditsOptions, ITextDocumentShowOptions, ITextEditorConfigurationUpdate, ITextEditorPositionData, IUndoStopOptions, MainThreadTextEditorsShape, TextEditorRevealType } from 'vs/workbench/api/common/extHost.protocol';
Expand All @@ -25,8 +25,8 @@ import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/wo
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { ILineChange } from 'vs/editor/common/diff/smartLinesDiffComputer';
import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers';
import { DEFAULT_EDITOR_ASSOCIATION, IEditorControl } from 'vs/workbench/common/editor';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorControl } from 'vs/workbench/common/editor';
import { getCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';

export interface IMainThreadEditorLocator {
Expand Down Expand Up @@ -127,7 +127,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
// preserve pre 1.38 behaviour to not make group active when preserveFocus: true
// but make sure to restore the editor to fix https://github.com/microsoft/vscode/issues/79633
activation: options.preserveFocus ? EditorActivation.RESTORE : undefined,
override: DEFAULT_EDITOR_ASSOCIATION.id
override: EditorResolution.EXCLUSIVE_ONLY
Comment thread
lramos15 marked this conversation as resolved.
};

const input: IResourceEditorInput = {
Expand All @@ -139,7 +139,10 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
if (!editor) {
return undefined;
}
return this._editorLocator.findTextEditorIdFor(editor);
// Composite editors are made up of many editors so we return the active one at the time of opening
const editorControl = editor.getControl();
Comment thread
lramos15 marked this conversation as resolved.
const codeEditor = getCodeEditor(editorControl);
return codeEditor ? this._editorLocator.getIdOfCodeEditor(codeEditor) : undefined;
}

async $tryShowEditor(id: string, position?: EditorGroupColumn): Promise<void> {
Expand Down