mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 19:18:32 -05:00
Fix duplicate editor windows on reload (#16893)
This commit is contained in:
@@ -29,6 +29,8 @@ export const SearchViewFocusedKey = new RawContextKey<boolean>('notebookSearchVi
|
||||
export const InputBoxFocusedKey = new RawContextKey<boolean>('inputBoxFocus', false);
|
||||
export const SearchInputBoxFocusedKey = new RawContextKey<boolean>('searchInputBoxFocus', false);
|
||||
|
||||
export const UNTITLED_NOTEBOOK_TYPEID = 'workbench.editorinputs.untitledNotebookInput';
|
||||
|
||||
export const enum NotebookLanguage {
|
||||
Notebook = 'Notebook',
|
||||
Ipynb = 'ipynb'
|
||||
|
||||
@@ -11,9 +11,10 @@ import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/not
|
||||
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { EditorInputCapabilities } from 'vs/workbench/common/editor';
|
||||
import { UNTITLED_NOTEBOOK_TYPEID } from 'sql/workbench/common/constants';
|
||||
|
||||
export class UntitledNotebookInput extends NotebookInput {
|
||||
public static ID: string = 'workbench.editorinputs.untitledNotebookInput';
|
||||
public static ID: string = UNTITLED_NOTEBOOK_TYPEID;
|
||||
|
||||
constructor(
|
||||
title: string,
|
||||
|
||||
@@ -19,6 +19,8 @@ import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/u
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { NO_TYPE_ID } from 'vs/workbench/services/workingCopy/common/workingCopy';
|
||||
import { IWorkingCopyEditorService } from 'vs/workbench/services/workingCopy/common/workingCopyEditorService';
|
||||
import { UntitledQueryEditorInput } from 'sql/workbench/common/editor/query/untitledQueryEditorInput'; // {{SQL CARBON EDIT}} Handle our untitled inputs as well
|
||||
import { UNTITLED_NOTEBOOK_TYPEID } from 'sql/workbench/common/constants'; // {{SQL CARBON EDIT}} Handle our untitled inputs as well
|
||||
|
||||
interface ISerializedUntitledTextEditorInput {
|
||||
resourceJSON: UriComponents;
|
||||
@@ -101,7 +103,7 @@ export class UntitledTextEditorWorkingCopyEditorHandler extends Disposable imple
|
||||
private installHandler(): void {
|
||||
this._register(this.workingCopyEditorService.registerHandler({
|
||||
handles: workingCopy => workingCopy.resource.scheme === Schemas.untitled && workingCopy.typeId === NO_TYPE_ID,
|
||||
isOpen: (workingCopy, editor) => editor instanceof UntitledTextEditorInput && isEqual(workingCopy.resource, editor.resource),
|
||||
isOpen: (workingCopy, editor) => (editor instanceof UntitledTextEditorInput || editor instanceof UntitledQueryEditorInput || editor.typeId === UNTITLED_NOTEBOOK_TYPEID) && isEqual(workingCopy.resource, editor.resource), // {{SQL CARBON EDIT}} Handle our untitled inputs as well. Notebook input can't be imported due to layering currently so just use the typeID for that
|
||||
createEditor: workingCopy => {
|
||||
let editorInputResource: URI;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user