diff --git a/src/ide/project.ts b/src/ide/project.ts index 5bd7737d..8db8f63f 100644 --- a/src/ide/project.ts +++ b/src/ide/project.ts @@ -1,5 +1,5 @@ -import { FileData, Dependency, SourceLine, SourceFile, CodeListing, CodeListingMap, WorkerError, Segment, WorkerResult, WorkerOutputResult, isUnchanged, isOutputResult, WorkerMessage, WorkerItemUpdate } from "../common/workertypes"; +import { FileData, Dependency, SourceLine, SourceFile, CodeListing, CodeListingMap, WorkerError, Segment, WorkerResult, WorkerOutputResult, isUnchanged, isOutputResult, WorkerMessage, WorkerItemUpdate, WorkerErrorResult, isErrorResult } from "../common/workertypes"; import { getFilenamePrefix, getFolderForPath, isProbablyBinary, getBasePlatform, getWithBinary } from "../common/util"; import { Platform } from "../common/baseplatform"; import localforage from "localforage"; @@ -129,6 +129,8 @@ export class CodeProject { } if (data && isOutputResult(data)) { this.processBuildResult(data); + } else if (isErrorResult(data)) { + this.processBuildListings(data); } this.callbackBuildResult(data); } @@ -376,7 +378,7 @@ export class CodeProject { this.sendBuild(); } - processBuildResult(data: WorkerOutputResult) { + processBuildListings(data: WorkerOutputResult | WorkerErrorResult) { // TODO: link listings with source files if (data.listings) { this.listings = data.listings; @@ -388,6 +390,14 @@ export class CodeProject { lst.assemblyfile = new SourceFile(lst.asmlines, lst.text); } } + } + + processBuildResult(data: WorkerOutputResult) { + this.processBuildListings(data); + this.processBuildSegments(data); + } + + processBuildSegments(data: WorkerOutputResult) { // save and sort segment list var segs = (this.platform.getMemoryMap && this.platform.getMemoryMap()["main"]) || []; if (data.segments) { segs = segs.concat(data.segments || []); } diff --git a/src/ide/ui.ts b/src/ide/ui.ts index b7f2607d..727b0e13 100644 --- a/src/ide/ui.ts +++ b/src/ide/ui.ts @@ -323,7 +323,7 @@ function refreshWindowList() { for (var lstfn in listings) { var lst = listings[lstfn]; // add listing if source/assembly file exists and has text - if ((lst.assemblyfile && lst.assemblyfile.text) || (lst.sourcefile && lst.sourcefile.text)) { + if ((lst.assemblyfile && lst.assemblyfile.text) || (lst.sourcefile && lst.sourcefile.text) || lst.text) { addWindowItem(lstfn, getFilenameForPath(lstfn), (path) => { return new ListingView(path); });