diff --git a/src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioForegroundDispatcher.cs b/src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioForegroundDispatcher.cs new file mode 100644 index 0000000000..1a8ab11930 --- /dev/null +++ b/src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioForegroundDispatcher.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.ComponentModel.Composition; +using Microsoft.VisualStudio.Shell; + +namespace Microsoft.VisualStudio.LanguageServices.Razor +{ + [Export(typeof(ForegroundDispatcher))] + internal class VisualStudioForegroundDispatcher : ForegroundDispatcher + { + public override bool IsForegroundThread => ThreadHelper.CheckAccess(); + } +}