Adding caching to execution plan and refactoring code and some other fixes (#18913)

* Making ep code modular for easy swithcing in and out

* Changing to innerText

* Fixing renames

* Fixing var name in one file
This commit is contained in:
Aasim Khan
2022-04-12 12:52:24 -07:00
committed by GitHub
parent 675969eebc
commit 387f4cd116
21 changed files with 1902 additions and 1122 deletions

View File

@@ -15,6 +15,7 @@ export class ExecutionPlanInput extends EditorInput {
public static SCHEMA: string = 'executionplan';
private _content?: string;
public _executionPlanFileViewUUID: string;
constructor(
private _uri: URI,
@@ -23,6 +24,14 @@ export class ExecutionPlanInput extends EditorInput {
super();
}
public get executionPlanFileViewUUID(): string {
return this._executionPlanFileViewUUID;
}
public set executionPlanFileViewUUID(v: string) {
this._executionPlanFileViewUUID = v;
}
override get typeId(): string {
return ExecutionPlanInput.ID;
}
@@ -31,7 +40,10 @@ export class ExecutionPlanInput extends EditorInput {
return path.basename(this._uri.fsPath);
}
public get content(): string | undefined {
public async content(): Promise<string> {
if (!this._content) {
this._content = (await this._fileService.read(this._uri, { acceptTextOnly: true })).value;
}
return this._content;
}