mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 09:35:40 -05:00
Merge from vscode 4d91d96e5e121b38d33508cdef17868bab255eae
This commit is contained in:
committed by
AzureDataStudio
parent
a971aee5bd
commit
5e7071e466
@@ -393,7 +393,7 @@ suite('commandLineService tests', () => {
|
||||
querymodelService.setup(c => c.onRunQueryComplete).returns(() => Event.None);
|
||||
let uri = URI.file(args._[0]);
|
||||
const workbenchinstantiationService = workbenchInstantiationService();
|
||||
const editorInput = workbenchinstantiationService.createInstance(FileEditorInput, uri, undefined, undefined);
|
||||
const editorInput = workbenchinstantiationService.createInstance(FileEditorInput, uri, undefined, undefined, undefined);
|
||||
const queryInput = new FileQueryEditorInput(undefined, editorInput, undefined, connectionManagementService.object, querymodelService.object, configurationService.object);
|
||||
queryInput.state.connected = true;
|
||||
const editorService: TypeMoq.Mock<IEditorService> = TypeMoq.Mock.ofType<IEditorService>(TestEditorService, TypeMoq.MockBehavior.Strict);
|
||||
|
||||
@@ -85,7 +85,7 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo
|
||||
|
||||
public sendMessage(message: string): void {
|
||||
if (this._webview) {
|
||||
this._webview.sendMessage(message);
|
||||
this._webview.postMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
|
||||
|
||||
public sendMessage(message: string): void {
|
||||
if (this._webview) {
|
||||
this._webview.sendMessage(message);
|
||||
this._webview.postMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const editorService = new MockEditorService(instantiationService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
@@ -86,7 +86,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const editorService = new MockEditorService(instantiationService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.other'), undefined, 'sql');
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.other'), undefined, 'sql', undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
@@ -101,7 +101,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const editorService = new MockEditorService(instantiationService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.notebook'), undefined, undefined);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.notebook'), undefined, undefined, undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
@@ -116,7 +116,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const editorService = new MockEditorService(instantiationService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.iynb'), undefined, 'notebook');
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.iynb'), undefined, 'notebook', undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
@@ -191,10 +191,10 @@ class MockEditorService extends TestEditorService {
|
||||
});
|
||||
}
|
||||
|
||||
fireOpenEditor(editor: IEditorInput, options: IEditorOptions | ITextEditorOptions | undefined, group: IEditorGroup, context: OpenEditorContext, id?: string) {
|
||||
fireOpenEditor(editor: IEditorInput, options: IEditorOptions | ITextEditorOptions | undefined, group: IEditorGroup, context: OpenEditorContext) {
|
||||
for (const handler of this.overridenOpens) {
|
||||
let response: IOpenEditorOverride | undefined;
|
||||
if (response = handler.open(editor, options, group, context, id)) {
|
||||
if (response = handler.open(editor, options, group, context)) {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ export default class WebViewComponent extends ComponentBase implements IComponen
|
||||
|
||||
private sendMessage(): void {
|
||||
if (this._webview && this.message) {
|
||||
this._webview.sendMessage(this.message);
|
||||
this._webview.postMessage(this.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
|
||||
import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { TestEnvironmentService, TestLifecycleService, TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestEnvironmentService, TestLifecycleService, TestTextFileService, workbenchInstantiationService, TestTextFileEditorModelManager } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { nb } from 'azdata';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
@@ -884,7 +884,7 @@ suite('Notebook Editor Model', function (): void {
|
||||
|
||||
async function createTextEditorModel(self: Mocha.ITestCallbackContext): Promise<NotebookEditorModel> {
|
||||
let textFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(self, defaultUri.toString()), 'utf8', undefined);
|
||||
(<TextFileEditorModelManager>accessor.textFileService.files).add(textFileEditorModel.resource, textFileEditorModel);
|
||||
(<TestTextFileEditorModelManager>accessor.textFileService.files).add(textFileEditorModel.resource, textFileEditorModel);
|
||||
await textFileEditorModel.load();
|
||||
return new NotebookEditorModel(defaultUri, textFileEditorModel, mockNotebookService.object, testResourcePropertiesService);
|
||||
}
|
||||
|
||||
@@ -15,9 +15,7 @@ import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'
|
||||
import { ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
type PublicPart<T> = { [K in keyof T]: T[K] };
|
||||
|
||||
export class FileQueryEditorInput extends QueryEditorInput implements PublicPart<FileEditorInput> {
|
||||
export class FileQueryEditorInput extends QueryEditorInput {
|
||||
|
||||
public static readonly ID = 'workbench.editorInput.fileQueryInput';
|
||||
|
||||
@@ -84,7 +82,7 @@ export class FileQueryEditorInput extends QueryEditorInput implements PublicPart
|
||||
return this.text.isResolved();
|
||||
}
|
||||
|
||||
public move(group: GroupIdentifier, target: URI): IMoveResult {
|
||||
return this.text.move(group, target);
|
||||
public rename(group: GroupIdentifier, target: URI): IMoveResult {
|
||||
return this.text.rename(group, target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ suite('Query Input Factory', () => {
|
||||
instantiationService.stub(IConnectionManagementService, connectionManagementService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const queryEditorLanguageAssociation = instantiationService.createInstance(QueryEditorLanguageAssociation);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined);
|
||||
queryEditorLanguageAssociation.convertInput(input);
|
||||
assert(connectionManagementService.numberConnects === 1, 'Convert input should have called connect when active OE connection exists');
|
||||
});
|
||||
@@ -49,7 +49,7 @@ suite('Query Input Factory', () => {
|
||||
instantiationService.stub(IConnectionManagementService, connectionManagementService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const queryEditorLanguageAssociation = instantiationService.createInstance(QueryEditorLanguageAssociation);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined);
|
||||
const response = queryEditorLanguageAssociation.convertInput(input);
|
||||
assert(isThenable(response));
|
||||
await response;
|
||||
@@ -64,7 +64,7 @@ suite('Query Input Factory', () => {
|
||||
instantiationService.stub(IConnectionManagementService, connectionManagementService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const queryEditorLanguageAssociation = instantiationService.createInstance(QueryEditorLanguageAssociation);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined);
|
||||
queryEditorLanguageAssociation.convertInput(input);
|
||||
assert(connectionManagementService.numberConnects === 1, 'Convert input should have called connect when active editor connection exists');
|
||||
});
|
||||
@@ -77,7 +77,7 @@ suite('Query Input Factory', () => {
|
||||
instantiationService.stub(IConnectionManagementService, connectionManagementService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const queryEditorLanguageAssociation = instantiationService.createInstance(QueryEditorLanguageAssociation);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined);
|
||||
const response = queryEditorLanguageAssociation.convertInput(input);
|
||||
assert(isThenable(response));
|
||||
await response;
|
||||
@@ -115,7 +115,7 @@ suite('Query Input Factory', () => {
|
||||
instantiationService.stub(IConnectionManagementService, connectionManagementService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const queryEditorLanguageAssociation = instantiationService.createInstance(QueryEditorLanguageAssociation);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined);
|
||||
queryEditorLanguageAssociation.syncConvertinput(input);
|
||||
assert(connectionManagementService.numberConnects === 0, 'Convert input should not have been called connect when no global connections exist');
|
||||
});
|
||||
@@ -127,7 +127,7 @@ suite('Query Input Factory', () => {
|
||||
instantiationService.stub(IConnectionManagementService, connectionManagementService);
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const queryEditorLanguageAssociation = instantiationService.createInstance(QueryEditorLanguageAssociation);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined);
|
||||
const response = queryEditorLanguageAssociation.convertInput(input);
|
||||
assert(isThenable(response));
|
||||
await response;
|
||||
|
||||
@@ -145,7 +145,7 @@ export class WebViewDialog extends Modal {
|
||||
}
|
||||
|
||||
public sendMessage(message: any): void {
|
||||
this._webview.sendMessage(message);
|
||||
this._webview.postMessage(message);
|
||||
}
|
||||
|
||||
public open() {
|
||||
|
||||
Reference in New Issue
Block a user