mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 17:23:19 -05:00
Notebooks: re-factor grid streaming (#12937)
* refactor grid streaming (convert to data first) * change convertRowsToHtml method to return value * remove griddataconversioncomplete checks * send row data from STS to gridoutput component * clean up code * send data updates to cell model * serialize cell output at the end of cell execution * remove unused parameters * update output contents instead of output reference * remove unnecessary promise * move azdata changes to proposed * update comment
This commit is contained in:
@@ -10,7 +10,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
|
||||
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
|
||||
export class FileNotebookInput extends NotebookInput {
|
||||
public static ID: string = 'workbench.editorinputs.fileNotebookInput';
|
||||
@@ -22,10 +21,9 @@ export class FileNotebookInput extends NotebookInput {
|
||||
@ITextModelService textModelService: ITextModelService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@INotebookService notebookService: INotebookService,
|
||||
@IExtensionService extensionService: IExtensionService,
|
||||
@INotificationService notificationService: INotificationService
|
||||
@IExtensionService extensionService: IExtensionService
|
||||
) {
|
||||
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService, notificationService);
|
||||
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService);
|
||||
}
|
||||
|
||||
public get textInput(): FileEditorInput {
|
||||
|
||||
@@ -33,9 +33,6 @@ import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileE
|
||||
import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
|
||||
import { NotebookFindModel } from 'sql/workbench/contrib/notebook/browser/find/notebookFindModel';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { INotification, INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import * as nls from 'vs/nls';
|
||||
import { NotebookModel } from 'sql/workbench/services/notebook/browser/models/notebookModel';
|
||||
|
||||
export type ModeViewSaveHandler = (handle: number) => Thenable<boolean>;
|
||||
@@ -231,8 +228,7 @@ export abstract class NotebookInput extends EditorInput {
|
||||
@ITextModelService private textModelService: ITextModelService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@INotebookService private notebookService: INotebookService,
|
||||
@IExtensionService private extensionService: IExtensionService,
|
||||
@INotificationService private notificationService: INotificationService
|
||||
@IExtensionService private extensionService: IExtensionService
|
||||
) {
|
||||
super();
|
||||
this._standardKernels = [];
|
||||
@@ -301,16 +297,6 @@ export abstract class NotebookInput extends EditorInput {
|
||||
}
|
||||
|
||||
async save(groupId: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
const conversionNotification: INotification = {
|
||||
severity: Severity.Info,
|
||||
message: nls.localize('convertingData', "Waiting for table data conversion to complete..."),
|
||||
progress: {
|
||||
infinite: true // Keep showing conversion notification until notificationHandle is closed
|
||||
}
|
||||
};
|
||||
const notificationHandle = this.notificationService.notify(conversionNotification);
|
||||
await this._model.getNotebookModel().gridDataConversionComplete;
|
||||
notificationHandle.close();
|
||||
this.updateModel();
|
||||
let input = await this.textInput.save(groupId, options);
|
||||
await this.setTrustForNewEditor(input);
|
||||
|
||||
@@ -10,7 +10,6 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
|
||||
import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
|
||||
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
|
||||
export class UntitledNotebookInput extends NotebookInput {
|
||||
public static ID: string = 'workbench.editorinputs.untitledNotebookInput';
|
||||
@@ -22,10 +21,9 @@ export class UntitledNotebookInput extends NotebookInput {
|
||||
@ITextModelService textModelService: ITextModelService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@INotebookService notebookService: INotebookService,
|
||||
@IExtensionService extensionService: IExtensionService,
|
||||
@INotificationService notificationService: INotificationService
|
||||
@IExtensionService extensionService: IExtensionService
|
||||
) {
|
||||
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService, notificationService);
|
||||
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService);
|
||||
}
|
||||
|
||||
public get textInput(): UntitledTextEditorInput {
|
||||
|
||||
Reference in New Issue
Block a user