1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Improved handling of missing source file

This commit is contained in:
Brian Fiete 2020-01-15 08:33:16 -08:00
parent 957f24e159
commit 7894fc73cc
5 changed files with 23 additions and 1 deletions

View file

@ -398,10 +398,16 @@ namespace IDE.Compiler
if (data == null) if (data == null)
{ {
String msg = new String(); String msg = new String();
msg.AppendF("FAILED TO LOAD FILE: {0}", sourceFilePath); msg.AppendF("ERROR: FAILED TO LOAD FILE '{0}' in project '{1}'", sourceFilePath, projectSource.mProject.mProjectName);
mQueuedOutput.Add(msg); mQueuedOutput.Add(msg);
passInstance.mFailed = true; passInstance.mFailed = true;
projectSourceCommand.mProjectSource.mLoadFailed = true;
} }
else
projectSourceCommand.mProjectSource.mLoadFailed = false;
if (mIsResolveOnly)
projectSourceCommand.mProjectSource.mLoadFailed = data == null;
if ((!mIsResolveOnly) && (data != null)) if ((!mIsResolveOnly) && (data != null))
IDEApp.sApp.mWorkspace.ProjectSourceCompiled(projectSource, data, char8IdData, canMoveSourceString); IDEApp.sApp.mWorkspace.ProjectSourceCompiled(projectSource, data, char8IdData, canMoveSourceString);

View file

@ -266,6 +266,7 @@ namespace IDE
public bool mHasChangedSinceLastCompile = true; public bool mHasChangedSinceLastCompile = true;
public bool mHasChangedSinceLastSuccessfulCompile = true; public bool mHasChangedSinceLastSuccessfulCompile = true;
public bool mLoadFailed;
public bool HasChangedSinceLastCompile public bool HasChangedSinceLastCompile
{ {
get get

View file

@ -167,6 +167,9 @@ namespace IDE.ui
if (passKind == .Parse) if (passKind == .Parse)
{ {
if (bfError.mFilePath == null)
bfError.mFilePath = new String("");
bool added = mParseErrors.TryAdd(bfError.mFilePath, var keyPtr, var valuePtr); bool added = mParseErrors.TryAdd(bfError.mFilePath, var keyPtr, var valuePtr);
if (added) if (added)
{ {

View file

@ -53,6 +53,13 @@ namespace IDE.ui
color = 0xFFE0E0FF; color = 0xFFE0E0FF;
else if (projectItem.mIncludeKind == .Ignore) else if (projectItem.mIncludeKind == .Ignore)
color = 0xFF909090; color = 0xFF909090;
if (let projectSource = projectItem as ProjectSource)
{
if (projectSource.mLoadFailed)
color = 0xFFFF0000;
}
mTextColor = color; mTextColor = color;
} }

View file

@ -1163,6 +1163,11 @@ namespace IDE.ui
//BackgroundResolve(new () => { DoClassify(.Autocomplete, resolveParams); }); //BackgroundResolve(new () => { DoClassify(.Autocomplete, resolveParams); });
else if (useResolveType == .ClassifyFullRefresh) else if (useResolveType == .ClassifyFullRefresh)
{ {
if ((mProjectSource?.mLoadFailed == true) && (!mLoadFailed))
{
mProjectSource.mLoadFailed = false;
}
// To avoid "flashing" on proper colorization vs FastClassify, we wait a bit for the proper classifying to finish // To avoid "flashing" on proper colorization vs FastClassify, we wait a bit for the proper classifying to finish
// on initial show // on initial show
int maxWait = (mUpdateCnt <= 1) ? 50 : 0; int maxWait = (mUpdateCnt <= 1) ? 50 : 0;