mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 17:23:19 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -13,7 +13,7 @@ import { Deferred } from 'sql/base/common/promise';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class DiffNotebookInput extends SideBySideEditorInput {
|
||||
public static ID: string = 'workbench.editorinputs.DiffNotebookInput';
|
||||
public static override ID: string = 'workbench.editorinputs.DiffNotebookInput';
|
||||
private _notebookService: INotebookService;
|
||||
private _logService: ILogService;
|
||||
|
||||
@@ -32,7 +32,7 @@ export class DiffNotebookInput extends SideBySideEditorInput {
|
||||
this.setupScrollListeners(originalInput, modifiedInput);
|
||||
}
|
||||
|
||||
public getTypeId(): string {
|
||||
override get typeId(): string {
|
||||
return DiffNotebookInput.ID;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ export class FileNotebookInput extends NotebookInput {
|
||||
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService);
|
||||
}
|
||||
|
||||
public get textInput(): FileEditorInput {
|
||||
public override get textInput(): FileEditorInput {
|
||||
return super.textInput as FileEditorInput;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export class FileNotebookInput extends NotebookInput {
|
||||
this.textInput.setPreferredMode(mode);
|
||||
}
|
||||
|
||||
public getTypeId(): string {
|
||||
override get typeId(): string {
|
||||
return FileNotebookInput.ID;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ export class NotebookEditorModel extends EditorModel {
|
||||
let dirty = this.textEditorModel instanceof ResourceEditorModel ? false : this.textEditorModel.isDirty();
|
||||
this.setDirty(dirty);
|
||||
}));
|
||||
this._register(this.textEditorModel.onDidLoad(async (e) => {
|
||||
this._register(this.textEditorModel.onDidResolve(async (e) => {
|
||||
if (this.textEditorModel instanceof TextFileEditorModel) {
|
||||
let model = this.getNotebookModel() as NotebookModel;
|
||||
await model.loadContents(model.trustedMode, true);
|
||||
@@ -253,7 +253,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._textInput;
|
||||
}
|
||||
|
||||
public revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
|
||||
public override revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
|
||||
return this._textInput.revert(group, options);
|
||||
}
|
||||
|
||||
@@ -279,14 +279,14 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._contentManager;
|
||||
}
|
||||
|
||||
public getName(): string {
|
||||
public override getName(): string {
|
||||
if (!this._title) {
|
||||
this._title = resources.basenameOrAuthority(this.resource);
|
||||
}
|
||||
return this._title;
|
||||
}
|
||||
|
||||
public isReadonly(): boolean {
|
||||
public override isReadonly(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -310,14 +310,14 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._standardKernels;
|
||||
}
|
||||
|
||||
async save(groupId: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
override async save(groupId: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
this.updateModel();
|
||||
let input = await this.textInput.save(groupId, options);
|
||||
await this.setTrustForNewEditor(input);
|
||||
return input;
|
||||
}
|
||||
|
||||
async saveAs(group: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
override async saveAs(group: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
this.updateModel();
|
||||
let input = await this.textInput.saveAs(group, options);
|
||||
await this.setTrustForNewEditor(input);
|
||||
@@ -362,8 +362,6 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
this._layoutChanged.fire();
|
||||
}
|
||||
|
||||
public abstract getTypeId(): string;
|
||||
|
||||
get resource(): URI {
|
||||
return this._resource;
|
||||
}
|
||||
@@ -376,7 +374,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
this._untitledEditorModel = value;
|
||||
}
|
||||
|
||||
async resolve(): Promise<NotebookEditorModel> {
|
||||
override async resolve(): Promise<NotebookEditorModel> {
|
||||
if (!this._modelResolveInProgress) {
|
||||
this._modelResolveInProgress = true;
|
||||
} else {
|
||||
@@ -401,7 +399,8 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
} else {
|
||||
const textEditorModelReference = await this.textModelService.createModelReference(this.resource);
|
||||
textEditorModelReference.object.textEditorModel.onBeforeAttached();
|
||||
textOrUntitledEditorModel = await textEditorModelReference.object.load() as TextFileEditorModel | ResourceEditorModel;
|
||||
await textEditorModelReference.object.resolve();
|
||||
textOrUntitledEditorModel = textEditorModelReference.object as TextFileEditorModel | ResourceEditorModel;
|
||||
}
|
||||
this._model = this._register(this.instantiationService.createInstance(NotebookEditorModel, this.resource, textOrUntitledEditorModel));
|
||||
this.hookDirtyListener(this._model.onDidChangeDirty, () => this._onDidChangeDirty.fire());
|
||||
@@ -440,7 +439,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
if (this._model && this._model.editorModel && this._model.editorModel.textEditorModel) {
|
||||
this._model.editorModel.textEditorModel.onBeforeDetached();
|
||||
}
|
||||
@@ -477,7 +476,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
/**
|
||||
* An editor that is dirty will be asked to be saved once it closes.
|
||||
*/
|
||||
isDirty(): boolean {
|
||||
override isDirty(): boolean {
|
||||
if (this._model) {
|
||||
return this._model.isDirty();
|
||||
} else if (this._textInput) {
|
||||
@@ -500,7 +499,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
this._model.updateModel();
|
||||
}
|
||||
|
||||
public matches(otherInput: any): boolean {
|
||||
public override matches(otherInput: any): boolean {
|
||||
if (otherInput instanceof NotebookInput) {
|
||||
return this.textInput.matches(otherInput.textInput);
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IEditorInputFactory, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions, IEditorInput } from 'vs/workbench/common/editor';
|
||||
import { IEditorInputFactoryRegistry, IEditorInput, IEditorInputSerializer, EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { FILE_EDITOR_INPUT_ID } from 'vs/workbench/contrib/files/common/files';
|
||||
@@ -18,7 +18,7 @@ import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
||||
import { DiffNotebookInput } from 'sql/workbench/contrib/notebook/browser/models/diffNotebookInput';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
const editorInputFactoryRegistry = Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactories);
|
||||
const editorInputFactoryRegistry = Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories);
|
||||
|
||||
export class NotebookEditorInputAssociation implements ILanguageAssociation {
|
||||
static readonly languages = [NotebookLanguage.Notebook, NotebookLanguage.Ipynb];
|
||||
@@ -45,9 +45,9 @@ export class NotebookEditorInputAssociation implements ILanguageAssociation {
|
||||
}
|
||||
}
|
||||
|
||||
export class FileNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
export class FileNoteBookEditorInputSerializer implements IEditorInputSerializer {
|
||||
serialize(editorInput: FileNotebookInput): string {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputFactory(FILE_EDITOR_INPUT_ID);
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(FILE_EDITOR_INPUT_ID);
|
||||
if (factory) {
|
||||
return factory.serialize(editorInput.textInput); // serialize based on the underlying input
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export class FileNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
}
|
||||
|
||||
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): FileNotebookInput | undefined {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputFactory(FILE_EDITOR_INPUT_ID);
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(FILE_EDITOR_INPUT_ID);
|
||||
const fileEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as FileEditorInput;
|
||||
return instantiationService.createInstance(FileNotebookInput, fileEditorInput.getName(), fileEditorInput.resource, fileEditorInput);
|
||||
}
|
||||
@@ -65,9 +65,9 @@ export class FileNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
}
|
||||
}
|
||||
|
||||
export class UntitledNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
export class UntitledNoteBookEditorInputFactory implements IEditorInputSerializer {
|
||||
serialize(editorInput: UntitledNotebookInput): string {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledTextEditorInput.ID);
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(UntitledTextEditorInput.ID);
|
||||
if (factory) {
|
||||
return factory.serialize(editorInput.textInput); // serialize based on the underlying input
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export class UntitledNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
}
|
||||
|
||||
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): UntitledNotebookInput | undefined {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledTextEditorInput.ID);
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(UntitledTextEditorInput.ID);
|
||||
const untitledEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as UntitledTextEditorInput;
|
||||
return instantiationService.createInstance(UntitledNotebookInput, untitledEditorInput.getName(), untitledEditorInput.resource, untitledEditorInput);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { FindMatch } from 'vs/editor/common/model';
|
||||
import { NotebookContentChange, INotebookModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import { NotebookChangeType } from 'sql/workbench/services/notebook/common/contracts';
|
||||
import { repeat } from 'vs/base/common/strings';
|
||||
import { ITextEditorModel } from 'vs/workbench/common/editor';
|
||||
import { ITextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
|
||||
export class NotebookTextFileModel {
|
||||
// save active cell's line/column in editor model for the beginning of the source property
|
||||
|
||||
@@ -26,7 +26,7 @@ export class UntitledNotebookInput extends NotebookInput {
|
||||
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService);
|
||||
}
|
||||
|
||||
public get textInput(): UntitledTextEditorInput {
|
||||
public override get textInput(): UntitledTextEditorInput {
|
||||
return super.textInput as UntitledTextEditorInput;
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ export class UntitledNotebookInput extends NotebookInput {
|
||||
this.textInput.setMode(mode);
|
||||
}
|
||||
|
||||
isUntitled(): boolean {
|
||||
override isUntitled(): boolean {
|
||||
// Subclasses need to explicitly opt-in to being untitled.
|
||||
return true;
|
||||
}
|
||||
|
||||
public getTypeId(): string {
|
||||
override get typeId(): string {
|
||||
return UntitledNotebookInput.ID;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user