diff --git a/VisualRust.Build/Rustc.cs b/VisualRust.Build/Rustc.cs index b93ce2af..dbc43b48 100644 --- a/VisualRust.Build/Rustc.cs +++ b/VisualRust.Build/Rustc.cs @@ -373,6 +373,10 @@ public static void LogRustcMessage(RustcMessageJson msg, string rootPath, TaskLo // todo all other fields // todo mb help key word is code.explanation + // cargo build json messages don't always contain a message component + if (msg == null) + return; + var type = msg.GetLevelAsEnum(); var primarySpan = msg.GetPrimarySpan(); var code = msg.GetErrorCodeAsString(); diff --git a/VisualRust.ProjectSystem.FileSystemMirroring/IO/MsBuildFileSystemWatcher.cs b/VisualRust.ProjectSystem.FileSystemMirroring/IO/MsBuildFileSystemWatcher.cs index 0bd3e593..b0d48770 100644 --- a/VisualRust.ProjectSystem.FileSystemMirroring/IO/MsBuildFileSystemWatcher.cs +++ b/VisualRust.ProjectSystem.FileSystemMirroring/IO/MsBuildFileSystemWatcher.cs @@ -13,6 +13,7 @@ using System.IO.Abstractions; using NotifyFilters = System.IO.NotifyFilters; using IOException = System.IO.IOException; +using Win32Exception = System.ComponentModel.Win32Exception; using ErrorEventArgs = System.IO.ErrorEventArgs; #if VS14 @@ -222,10 +223,14 @@ private static bool IsFileAllowed(string rootDirectory, string fullPath, shortRelativePath = null; if (fullPath.StartsWithIgnoreCase(rootDirectory)) { relativePath = PathHelper.MakeRelative(rootDirectory, fullPath); - try { + try + { shortRelativePath = fileSystem.ToShortRelativePath(fullPath, rootDirectory); return !string.IsNullOrEmpty(shortRelativePath) && filter.IsFileAllowed(relativePath, fileSystem.FileInfo.FromFileName(fullPath).Attributes); - } catch (IOException) { } catch (UnauthorizedAccessException) { } // File isn't allowed if it isn't accessible + } + catch (IOException) { } + catch (UnauthorizedAccessException) { } // File isn't allowed if it isn't accessible + catch (Win32Exception) { } // ToShortPath can throw a Win32Exception if the file doesn't exist anymore, which isn't exceptional } return false; } diff --git a/VisualRust.ProjectSystem.FileSystemMirroring/Project/FileSystemMirroringProject.cs b/VisualRust.ProjectSystem.FileSystemMirroring/Project/FileSystemMirroringProject.cs index dd6a51e5..131813ab 100644 --- a/VisualRust.ProjectSystem.FileSystemMirroring/Project/FileSystemMirroringProject.cs +++ b/VisualRust.ProjectSystem.FileSystemMirroring/Project/FileSystemMirroringProject.cs @@ -137,6 +137,7 @@ private async Task ReevaluateLoadedConfiguredProjects(CancellationToken cancella foreach (var configuredProject in _unconfiguredProject.LoadedConfiguredProjects) { try { var jsproj = await access.GetProjectAsync(configuredProject, cancellationToken); + jsproj.MarkDirty(); jsproj.ReevaluateIfNecessary(); } catch (Exception ex) { System.Diagnostics.Debug.Fail("We were unable to mark a configuration as dirty" + ex.Message, ex.StackTrace);