fsprojects/VisualFSharpPowerTools — pull request #231 by vasily-kirichenko (2014-03-21 16:56:23+00:00)
Title: make DTE.GetActiveDocument safe

It fixes the following exception from VS log:

```
System.ArgumentException: Параметр задан неверно. (Исключение из HRESULT: 0x80070057 (E_INVALIDARG)) at EnvDTE._DTE.get_ActiveDocument() at
FSharpVSPowerTools.ProjectSystem.VSUtils.doc@138.Invoke(Unit unitVar) at
FSharpVSPowerTools.MaybeBuilder.Delay[T](FSharpFunc`2 f) at
FSharpVSPowerTools.ProjectSystem.VSUtils.DTE.GetActiveDocument(DTE ) at
.$SyntaxConstructClassifier.clo@45-23.Invoke(Unit unitVar) at
FSharpVSPowerTools.MaybeBuilder.Delay[T](FSharpFunc`2 f) at
FSharpVSPowerTools.SyntaxColoring.SyntaxConstructClassifier.updateSyntaxConstructClassifiers() at
.$SyntaxConstructClassifier.-ctor@66-41.Invoke(Boolean _arg4) at FSharpVSPowerTools.ProjectSystem.VSUtils.DocumentEventsListener..ctor(FSharpList`1 events, TimeSpan delay, FSharpFunc`2 update) at
FSharpVSPowerTools.SyntaxColoring.SyntaxConstructClassifier..ctor(ITextBuffer buffer, IClassificationTypeRegistryService classificationRegistry, VSLanguageService vsLanguageService, IServiceProvider serviceProvider) at FSharpVSPowerTools.SyntaxConstructClassifierProvider.<>c__DisplayClass1.b__0() at
Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator) at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Func`1 creator) at FSharpVSPowerTools.SyntaxConstructClassifierProvider.GetClassifier(ITextBuffer buffer) at
Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTaggerProvider.<>c__DisplayClass1`1.b__0(IClassifierProvider provider) at
Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeMatchingFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable`1 lazyFactories, Func`2 getter, IContentType dataContentType, Object errorSource)
```