diff --git a/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb b/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb index ab2441a9a0e7c..d6747d912d4b4 100644 --- a/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb +++ b/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb @@ -2502,7 +2502,7 @@ public class Goo End Function - + Public Async Function LocalFunctionAttributeNamedPropertyCompletionCommitWithTab(showCompletionInArgumentLists As Boolean) As Task Using state = TestStateFactory.CreateCSharpTestState( diff --git a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspace.cs b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspace.cs index b3d8e77f2d91b..b85e39e017cf0 100644 --- a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspace.cs +++ b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspace.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Threading; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.FindSymbols; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Shared.Extensions; @@ -24,6 +25,11 @@ public abstract class VisualStudioWorkspace : Workspace private BackgroundCompiler? _backgroundCompiler; private readonly BackgroundParser _backgroundParser; + static VisualStudioWorkspace() + { + WatsonReporter.InitializeFatalErrorHandlers(); + } + internal VisualStudioWorkspace(HostServices hostServices) : base(hostServices, WorkspaceKind.Host) { diff --git a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb index 81aa089d9a347..476b0a5248a15 100644 --- a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb +++ b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb @@ -327,9 +327,11 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics source.AddNewErrors(projectId1, GetDiagnosticData(projectId1)) Await waiter.ExpeditedWaitAsync() + Dim numberOfUpdateCalls = 0 AddHandler source.BuildProgressChanged, Sub(o, progress) If progress = ExternalErrorDiagnosticUpdateSource.BuildProgress.Updated Then - Assert.Equal(1, source.GetBuildErrors().Length) + numberOfUpdateCalls += 1 + Assert.Equal(numberOfUpdateCalls, source.GetBuildErrors().Length) ElseIf progress = ExternalErrorDiagnosticUpdateSource.BuildProgress.Done Then Assert.Equal(2, source.GetBuildErrors().Length) End If diff --git a/src/VisualStudio/Core/Test/Venus/DocumentService_IntegrationTests.vb b/src/VisualStudio/Core/Test/Venus/DocumentService_IntegrationTests.vb index 94c321c941ce5..301008f464ee7 100644 --- a/src/VisualStudio/Core/Test/Venus/DocumentService_IntegrationTests.vb +++ b/src/VisualStudio/Core/Test/Venus/DocumentService_IntegrationTests.vb @@ -401,15 +401,13 @@ class { } Public Sub AddCommandTarget(target As IOleCommandTarget, ByRef [next] As IOleCommandTarget) Implements IFindAllReferencesWindow.AddCommandTarget Throw New NotImplementedException() End Sub +#End Region Public Sub SetProgress(progress As Double) Implements IFindAllReferencesWindow.SetProgress - Throw New NotImplementedException() End Sub Public Sub SetProgress(completed As Integer, maximum As Integer) Implements IFindAllReferencesWindow.SetProgress - Throw New NotImplementedException() End Sub -#End Region End Class Private Class TableDataSink diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs index 499701cd16e1d..f9bc29eb0da7d 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs @@ -79,8 +79,7 @@ void M() }"; VisualStudio.Editor.SetText(text); VisualStudio.Editor.PlaceCaret("x"); - VisualStudio.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.ReferenceHighlighting); - VisualStudio.ExecuteCommand("Edit.NextHighlightedReference"); + VisualStudio.Editor.InvokeNavigateToNextHighlightedReference(); VisualStudio.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.ReferenceHighlighting); VisualStudio.Editor.Verify.CurrentLineText("x$$ = 3;", assertCaretPosition: true, trimWhitespace: true); } diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicKeywordHighlighting.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicKeywordHighlighting.cs index cfea05a270ee8..9c900c918e348 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicKeywordHighlighting.cs +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicKeywordHighlighting.cs @@ -35,7 +35,7 @@ End Sub End Class"); Verify("To", 4); - VisualStudio.ExecuteCommand("Edit.NextHighlightedReference"); + VisualStudio.Editor.InvokeNavigateToNextHighlightedReference(); VisualStudio.Editor.Verify.CurrentLineText("For a = 0 To 1 Step$$ 1", assertCaretPosition: true, trimWhitespace: true); } diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs b/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs index ac3625a0817dc..a137ef6b931f1 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/Editor_OutOfProc.cs @@ -86,6 +86,12 @@ public ImmutableArray GetTagSpans(string tagId) return builder.ToImmutableAndFree(); } + public void InvokeNavigateToNextHighlightedReference() + { + _instance.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.ReferenceHighlighting); + _instance.ExecuteCommand(WellKnownCommandNames.Edit_NextHighlightedReference); + } + public string GetCurrentCompletionItem() { WaitForCompletionSet(); diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/WellKnownCommandNames.cs b/src/VisualStudio/IntegrationTest/TestUtilities/WellKnownCommandNames.cs index e358da8bc569a..5e59a6edc2ecb 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/WellKnownCommandNames.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/WellKnownCommandNames.cs @@ -25,6 +25,7 @@ public static class WellKnownCommandNames public const string Edit_LineEnd = "Edit.LineEnd"; public const string Edit_LineStartExtend = "Edit.LineStartExtend"; public const string Edit_LineEndExtend = "Edit.LineEndExtend"; + public const string Edit_NextHighlightedReference = "Edit.NextHighlightedReference"; public const string Edit_SelectAll = "Edit.SelectAll"; public const string Edit_Copy = "Edit.Copy"; public const string Edit_Cut = "Edit.Cut"; diff --git a/src/Workspaces/Remote/ServiceHub/Microsoft.CodeAnalysis.Remote.ServiceHub.csproj b/src/Workspaces/Remote/ServiceHub/Microsoft.CodeAnalysis.Remote.ServiceHub.csproj index 2403bb45f22eb..64df51e3276f5 100644 --- a/src/Workspaces/Remote/ServiceHub/Microsoft.CodeAnalysis.Remote.ServiceHub.csproj +++ b/src/Workspaces/Remote/ServiceHub/Microsoft.CodeAnalysis.Remote.ServiceHub.csproj @@ -41,7 +41,6 @@ - diff --git a/src/Workspaces/Remote/ServiceHub/Services/BrokeredServiceBase.cs b/src/Workspaces/Remote/ServiceHub/Services/BrokeredServiceBase.cs index 782eab6164252..192b4e24163a1 100644 --- a/src/Workspaces/Remote/ServiceHub/Services/BrokeredServiceBase.cs +++ b/src/Workspaces/Remote/ServiceHub/Services/BrokeredServiceBase.cs @@ -35,8 +35,6 @@ internal abstract partial class BrokeredServiceBase : IDisposable static BrokeredServiceBase() { - // Use a TraceListener hook to intercept assertion failures and report them through FatalError. - WatsonTraceListener.Install(); } protected BrokeredServiceBase(in ServiceConstructionArguments arguments) diff --git a/src/Workspaces/Remote/ServiceHub/Services/ServiceBase.cs b/src/Workspaces/Remote/ServiceHub/Services/ServiceBase.cs index ea49ebfac254a..83862e28eed8d 100644 --- a/src/Workspaces/Remote/ServiceHub/Services/ServiceBase.cs +++ b/src/Workspaces/Remote/ServiceHub/Services/ServiceBase.cs @@ -43,8 +43,7 @@ internal abstract class ServiceBase : IDisposable static ServiceBase() { - // Use a TraceListener hook to intercept assertion failures and report them through FatalError. - WatsonTraceListener.Install(); + WatsonReporter.InitializeFatalErrorHandlers(); } protected ServiceBase(IServiceProvider serviceProvider, Stream stream, IEnumerable? jsonConverters = null)