Skip to content

Commit

Permalink
fix(build): build fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
prb28 committed Sep 15, 2018
1 parent 9148cc6 commit 5541342
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
49 changes: 30 additions & 19 deletions src/extensionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,53 @@ import { StatusManager } from "./status";
import { Disassembler } from './disassemble';

export class ExtensionState {
private compiler: VASMCompiler;
private errorDiagnosticCollection: vscode.DiagnosticCollection;
private warningDiagnosticCollection: vscode.DiagnosticCollection;
private statusManager: StatusManager;
private calc: Calc;
private disassembler: Disassembler;
private static instance: ExtensionState;
private compiler: VASMCompiler | undefined;
private errorDiagnosticCollection: vscode.DiagnosticCollection | undefined;
private warningDiagnosticCollection: vscode.DiagnosticCollection | undefined;
private statusManager: StatusManager | undefined;
private calc: Calc | undefined;
private disassembler: Disassembler | undefined;
public static getInstance() {
return INSTANCE;
}
public constructor() {
this.compiler = new VASMCompiler();
this.errorDiagnosticCollection = vscode.languages.createDiagnosticCollection('m68k-error');
this.warningDiagnosticCollection = vscode.languages.createDiagnosticCollection('m68k-warning');
this.statusManager = new StatusManager();
this.calc = new Calc();
this.disassembler = new Disassembler();
if (!ExtensionState.instance) {
ExtensionState.instance = new ExtensionState();
}
return ExtensionState.instance;
}
public getErrorDiagnosticCollection(): vscode.DiagnosticCollection {
if (this.errorDiagnosticCollection === undefined) {
this.errorDiagnosticCollection = vscode.languages.createDiagnosticCollection('m68k-error');
}
return this.errorDiagnosticCollection;
}
public getWarningDiagnosticCollection(): vscode.DiagnosticCollection {
if (this.warningDiagnosticCollection === undefined) {
this.warningDiagnosticCollection = vscode.languages.createDiagnosticCollection('m68k-warning');
}
return this.warningDiagnosticCollection;
}
public getStatusManager(): StatusManager {
if (this.statusManager === undefined) {
this.statusManager = new StatusManager();
}
return this.statusManager;
}
public getCalc(): Calc {
if (this.calc === undefined) {
this.calc = new Calc();
}
return this.calc;
}
public getCompiler(): VASMCompiler {
if (this.compiler === undefined) {
this.compiler = new VASMCompiler();
}
return this.compiler;
}
public getDisassembler(): Disassembler {
if (this.disassembler === undefined) {
this.disassembler = new Disassembler();
}
return this.disassembler;
}
}


const INSTANCE = new ExtensionState();
}
4 changes: 0 additions & 4 deletions src/test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,9 @@ describe("Global Extension Tests", function () {
expect.fail("Editor not available");
}
});
<<<<<<< HEAD
it("Should evaluate the selection in the status bar", () => {
=======
it.only("Should evaluate the selection in the status bar", () => {
this.timeout(60000);
let calc = ExtensionState.getInstance().getCalc();
>>>>>>> 2d1f686ff3348ef70f9477ce97dbf57a2d9c74bd
// Get the satus value
// tslint:disable-next-line:no-unused-expression
expect(calc).to.not.be.undefined;
Expand Down

0 comments on commit 5541342

Please sign in to comment.