From a70d210ca9e37b76431f77b96871ae98da81175e Mon Sep 17 00:00:00 2001 From: Darren Kopp Date: Thu, 9 Jan 2014 12:11:10 -0700 Subject: [PATCH] catch all exceptions that bubble don't want to crash vs --- SassyStudio.2012/Editor/GenerateCssOnSave.cs | 28 ++++++++++++++----- SassyStudio.2012/SassyStudioPackage.cs | 2 +- .../source.extension.vsixmanifest | 2 +- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/SassyStudio.2012/Editor/GenerateCssOnSave.cs b/SassyStudio.2012/Editor/GenerateCssOnSave.cs index 3a31108..dcff811 100644 --- a/SassyStudio.2012/Editor/GenerateCssOnSave.cs +++ b/SassyStudio.2012/Editor/GenerateCssOnSave.cs @@ -87,19 +87,33 @@ private void OnFileActionOccurred(object sender, TextDocumentFileActionEventArgs private void GenerateRootDocument(DateTime time, string path) { - GenerateCss(time, path); - GenerateAllReferencing(time, path); + try + { + GenerateCss(time, path); + GenerateAllReferencing(time, path); + } + catch (Exception ex) + { + Logger.Log(ex, "Unhandled exception."); + } } private void GenerateAllReferencing(DateTime time, string path) { - var source = new FileInfo(path); - var documents = DocumentCache.Documents; + try + { + var source = new FileInfo(path); + var documents = DocumentCache.Documents; - foreach (var document in documents) + foreach (var document in documents) + { + if (IsReferenced(source, document, new HashSet())) + GenerateCss(time, document.Source.FullName); + } + } + catch (Exception ex) { - if (IsReferenced(source, document, new HashSet())) - GenerateCss(time, document.Source.FullName); + Logger.Log(ex, "Unhandled exception."); } } diff --git a/SassyStudio.2012/SassyStudioPackage.cs b/SassyStudio.2012/SassyStudioPackage.cs index cd5b337..195bd6d 100644 --- a/SassyStudio.2012/SassyStudioPackage.cs +++ b/SassyStudio.2012/SassyStudioPackage.cs @@ -13,7 +13,7 @@ namespace SassyStudio { [PackageRegistration(UseManagedResourcesOnly = true)] - [InstalledProductRegistration("#110", "#112", "0.8.8.3", IconResourceID = 400)] + [InstalledProductRegistration("#110", "#112", "0.8.8.4", IconResourceID = 400)] [GuidAttribute(Guids.guidSassyStudioPkgString)] [ProvideAutoLoad(UIContextGuids80.SolutionExists)] [ProvideOptionPage(typeof(ScssOptions), "Sassy Studio", "General", 101, 102, true, new[] { "CSS", "SCSS" })] diff --git a/SassyStudio.2012/source.extension.vsixmanifest b/SassyStudio.2012/source.extension.vsixmanifest index 858efdd..1e37040 100644 --- a/SassyStudio.2012/source.extension.vsixmanifest +++ b/SassyStudio.2012/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + SassyStudio Provides some support for sass files in visual studio https://github.com/darrenkopp/SassyStudio