mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
Merge from vscode ad407028575a77ea387eb7cc219b323dc017b686
This commit is contained in:
committed by
Anthony Dresser
parent
404260b8a0
commit
4ad73d381c
@@ -205,7 +205,6 @@ class TabImpl extends ModelViewPanelImpl implements azdata.window.DialogTab {
|
||||
|
||||
public title: string;
|
||||
public content: string;
|
||||
public handle: number;
|
||||
|
||||
public setModelViewId(value: string) {
|
||||
super.setModelViewId(value);
|
||||
|
||||
@@ -55,7 +55,7 @@ export class BackupDialog extends Modal {
|
||||
* Get the bootstrap params and perform the bootstrap
|
||||
*/
|
||||
private bootstrapAngular(bodyContainer: HTMLElement) {
|
||||
this._instantiationService.invokeFunction(bootstrapAngular,
|
||||
this._instantiationService.invokeFunction<void, any[]>(bootstrapAngular,
|
||||
BackupModule,
|
||||
bodyContainer,
|
||||
BACKUP_SELECTOR,
|
||||
|
||||
@@ -409,7 +409,7 @@ suite('Test class NotebookEditor:', () => {
|
||||
const searchString = getRandomString(1, 10);
|
||||
const matchCase = true;
|
||||
const wholeWord = true;
|
||||
const searchScope = new NotebookRange(<ICellModel>{}, 1, 1, 1, 1);
|
||||
const searchScope = [new NotebookRange(<ICellModel>{}, 1, 1, 1, 1)];
|
||||
const currentMatch = <NotebookRange>{};
|
||||
test(`Verifies _onFindStateChange callback when searchScope is defined, visibility='${visibility}', searchString='${searchString}', matchCase='${matchCase}', wholeWord='${wholeWord}'`, async () => {
|
||||
const { findReplaceStateChangedEvent, notebookFindModelMock, findDecorationsMock, notebookFindModel, notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
||||
@@ -444,7 +444,7 @@ suite('Test class NotebookEditor:', () => {
|
||||
const searchString = getRandomString(1, 10);
|
||||
const matchCase = true;
|
||||
const wholeWord = true;
|
||||
const searchScope = new NotebookRange(<ICellModel>{}, 1, 1, 1, 1);
|
||||
const searchScope = [new NotebookRange(<ICellModel>{}, 1, 1, 1, 1)];
|
||||
const currentMatch = <NotebookRange>{};
|
||||
const { notebookFindModelMock, notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
||||
notebookFindModelMock.setup(x => x.getIndexByRange(TypeMoq.It.isAny())).returns((_range: NotebookRange) => {
|
||||
@@ -469,7 +469,7 @@ suite('Test class NotebookEditor:', () => {
|
||||
const searchString = getRandomString(1, 10);
|
||||
const matchCase = true;
|
||||
const wholeWord = true;
|
||||
const searchScope = new NotebookRange(<ICellModel>{}, 1, 1, 1, 1);
|
||||
const searchScope = [new NotebookRange(<ICellModel>{}, 1, 1, 1, 1)];
|
||||
const currentMatch = <NotebookRange>{};
|
||||
const { notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
||||
untitledNotebookInput.notebookFindModel.notebookModel = undefined; // clear preexisting notebookModel
|
||||
@@ -499,7 +499,7 @@ suite('Test class NotebookEditor:', () => {
|
||||
searchString: getRandomString(1, 10),
|
||||
matchCase: true,
|
||||
wholeWord: true,
|
||||
searchScope: <NotebookRange>{}
|
||||
searchScope: [<NotebookRange>{}]
|
||||
};
|
||||
findState.change(newState, false);
|
||||
untitledNotebookInput.notebookFindModel.notebookModel = undefined; // clear preexisting notebookModel
|
||||
@@ -530,7 +530,7 @@ suite('Test class NotebookEditor:', () => {
|
||||
searchString: getRandomString(1, 10),
|
||||
matchCase: true,
|
||||
wholeWord: true,
|
||||
searchScope: <NotebookRange>{}
|
||||
searchScope: [<NotebookRange>{}]
|
||||
};
|
||||
findState.change(newState, false); //installs _updateFinderMatchState as event handler for onFindCountChange event
|
||||
let updateFinderMatchStateCalled = false;
|
||||
@@ -596,7 +596,7 @@ async function verifyFindCallsWhenFindStateChangeCallbackFires(instantiationServ
|
||||
findDecorationsMock.verify(x => x.clearDecorations(), TypeMoq.Times.once());
|
||||
}
|
||||
|
||||
async function findStateChangeSetup(instantiationService: TestInstantiationService, workbenchThemeService: any, notebookService: NotebookService, untitledNotebookInput: UntitledNotebookInput, modelFindExpression: string, currentMatch: NotebookRange, searchString: string, wholeWord: boolean, matchCase: boolean, searchScope: NotebookRange | null = undefined, findMatches: Array<NotebookFindMatch> = []) {
|
||||
async function findStateChangeSetup(instantiationService: TestInstantiationService, workbenchThemeService: any, notebookService: NotebookService, untitledNotebookInput: UntitledNotebookInput, modelFindExpression: string, currentMatch: NotebookRange, searchString: string, wholeWord: boolean, matchCase: boolean, searchScope: NotebookRange[] | null = undefined, findMatches: Array<NotebookFindMatch> = []) {
|
||||
const findReplaceStateChangedEvent: FindReplaceStateChangedEvent = {
|
||||
searchString: searchString !== undefined,
|
||||
matchCase: matchCase,
|
||||
@@ -752,4 +752,3 @@ function createEditor(notebookEditor: NotebookEditor) {
|
||||
let parentHtmlElement = document.createElement('div');
|
||||
notebookEditor.create(parentHtmlElement); // adds notebookEditor to new htmlElement as parent
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,9 @@ export class NotebookEditorStub extends stubs.NotebookEditorStub {
|
||||
model: INotebookModel | undefined;
|
||||
cells?: ICellModel[] = [];
|
||||
|
||||
get id(): string {
|
||||
return this.notebookParams?.notebookUri?.toString();
|
||||
}
|
||||
public readonly id = this.notebookParams?.notebookUri?.toString();
|
||||
|
||||
get modelReady(): Promise<INotebookModel> {
|
||||
return Promise.resolve(this.model);
|
||||
}
|
||||
public readonly modelReady: Promise<INotebookModel> = Promise.resolve(this.model);
|
||||
|
||||
// Normally one needs to provide either the editor or the instantiationService as the constructor parameter
|
||||
constructor({ cellGuid, instantiationService, editor, model, notebookParams }: { cellGuid?: string; instantiationService?: IInstantiationService; editor?: QueryTextEditor; model?: INotebookModel, notebookParams?: INotebookParams } = {}) {
|
||||
|
||||
@@ -165,7 +165,10 @@ class ServiceAccessor {
|
||||
}
|
||||
|
||||
class MockEditorService extends TestEditorService {
|
||||
public readonly activeEditor: IEditorInput | undefined = undefined;
|
||||
private __activeEditor: IEditorInput | undefined = undefined;
|
||||
public get activeEditor(): IEditorInput | undefined {
|
||||
return this.__activeEditor;
|
||||
}
|
||||
|
||||
constructor(instantiationService?: IInstantiationService) {
|
||||
super();
|
||||
@@ -174,7 +177,7 @@ class MockEditorService extends TestEditorService {
|
||||
const accessor = workbenchinstantiationService.createInstance(ServiceAccessor);
|
||||
const service = accessor.untitledTextEditorService;
|
||||
const untitledInput = instantiationService.createInstance(UntitledTextEditorInput, service.create({ associatedResource: URI.file('/test/file') }));
|
||||
this.activeEditor = instantiationService.createInstance(UntitledQueryEditorInput, '', untitledInput, undefined);
|
||||
this.__activeEditor = instantiationService.createInstance(UntitledQueryEditorInput, '', untitledInput, undefined);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +140,9 @@ export class ConnectionDialogWidget extends Modal implements IViewPaneContainer
|
||||
this.viewContainer = container;
|
||||
this.viewContainerModel = viewDescriptorService.getViewContainerModel(container);
|
||||
}
|
||||
getActionsContext(): unknown {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the available connection providers, this is called when new providers are registered
|
||||
|
||||
@@ -114,7 +114,7 @@ export class DialogPane extends Disposable implements IThemable {
|
||||
* Bootstrap angular for the dialog's model view controller with the given model view ID
|
||||
*/
|
||||
private initializeModelViewContainer(bodyContainer: HTMLElement, modelViewId: string, tab?: DialogTab) {
|
||||
this._instantiationService.invokeFunction(bootstrapAngular,
|
||||
this._instantiationService.invokeFunction<void, any[]>(bootstrapAngular,
|
||||
DialogModule,
|
||||
bodyContainer,
|
||||
'dialog-modelview-container',
|
||||
|
||||
Reference in New Issue
Block a user