mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
More work around isolating node imports (#6512)
* more work around isolating node imports * rewrite query plan input * fix hygiene errors * fix tests * address feedback * remove welcome page changes
This commit is contained in:
@@ -60,11 +60,11 @@ export class QueryPlanEditor extends BaseEditor {
|
||||
public layout(dimension: DOM.Dimension): void {
|
||||
}
|
||||
|
||||
public setInput(input: QueryPlanInput, options: EditorOptions): Promise<void> {
|
||||
public async setInput(input: QueryPlanInput, options: EditorOptions): Promise<void> {
|
||||
if (this.input instanceof QueryPlanInput && this.input.matches(input)) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
await input.resolve();
|
||||
if (!input.hasInitialized) {
|
||||
this.bootstrapAngular(input);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import { EditorInput, EditorModel } from 'vs/workbench/common/editor';
|
||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export class QueryPlanInput extends EditorInput {
|
||||
|
||||
@@ -14,8 +16,12 @@ export class QueryPlanInput extends EditorInput {
|
||||
public static SCHEMA: string = 'queryplan';
|
||||
|
||||
private _uniqueSelector: string;
|
||||
private _xml: string;
|
||||
|
||||
constructor(private _xml: string, private _uri: string, private _connection: ConnectionManagementInfo) {
|
||||
constructor(
|
||||
private _uri: URI, private _connection: ConnectionManagementInfo,
|
||||
@IFileService private readonly fileService: IFileService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -36,7 +42,7 @@ export class QueryPlanInput extends EditorInput {
|
||||
}
|
||||
|
||||
public getUri(): string {
|
||||
return this._uri;
|
||||
return this._uri.toString();
|
||||
}
|
||||
|
||||
public supportsSplitEditor(): boolean {
|
||||
@@ -48,7 +54,10 @@ export class QueryPlanInput extends EditorInput {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public resolve(refresh?: boolean): Promise<EditorModel> {
|
||||
public async resolve(refresh?: boolean): Promise<EditorModel> {
|
||||
if (!this._xml) {
|
||||
this._xml = (await this.fileService.readFile(this._uri)).value.toString();
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user