From b02bf17d1f12902559e914bf022a014e4542e7f4 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Thu, 23 Jan 2020 17:06:32 -0800 Subject: [PATCH] Fixes for broken notebook experience (#8944) * Fixes for broken notebook experience * add sql carbon edit * sql carbon edit * add another sql carbon edit for import * Set untitledResource instead of no resource --- .../api/browser/mainThreadNotebookDocumentsAndEditors.ts | 2 +- .../services/workingCopy/common/workingCopyService.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sql/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts b/src/sql/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts index 58c0483dba..a4fc62a074 100644 --- a/src/sql/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts +++ b/src/sql/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts @@ -458,7 +458,7 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements }; let isUntitled: boolean = uri.scheme === Schemas.untitled; - const fileInput = isUntitled ? this._untitledEditorService.create({ associatedResource: uri, mode: 'notebook', initialValue: options.initialContent }) : + const fileInput = isUntitled ? this._untitledEditorService.create({ untitledResource: uri, mode: 'notebook', initialValue: options.initialContent }) : this._editorService.createInput({ resource: uri, mode: 'notebook' }); let input: NotebookInput; if (isUntitled) { diff --git a/src/vs/workbench/services/workingCopy/common/workingCopyService.ts b/src/vs/workbench/services/workingCopy/common/workingCopyService.ts index 5319e9a0b2..2aa7ea9a09 100644 --- a/src/vs/workbench/services/workingCopy/common/workingCopyService.ts +++ b/src/vs/workbench/services/workingCopy/common/workingCopyService.ts @@ -10,6 +10,7 @@ import { URI } from 'vs/base/common/uri'; import { Disposable, IDisposable, toDisposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; import { TernarySearchTree, values } from 'vs/base/common/map'; import { ISaveOptions, IRevertOptions } from 'vs/workbench/common/editor'; +import { Schemas } from 'vs/base/common/network'; // {{SQL CARBON EDIT}} @chlafreniere need to block working copies of notebook editors from being tracked export const enum WorkingCopyCapabilities { @@ -138,6 +139,11 @@ export class WorkingCopyService extends Disposable implements IWorkingCopyServic registerWorkingCopy(workingCopy: IWorkingCopy): IDisposable { const disposables = new DisposableStore(); + // {{SQL CARBON EDIT}} @chlafreniere need to block working copies of notebook editors from being tracked + if (workingCopy.resource.path.includes('notebook-editor-') && workingCopy.resource.scheme === Schemas.untitled) { + return disposables; + } + // Registry let workingCopiesForResource = this.mapResourceToWorkingCopy.get(workingCopy.resource.toString()); if (!workingCopiesForResource) {