未验证 提交 ffa4e6d2 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #47554 from sharwell/disallow-fail

Initialize FatalError handlers in VS and OOP
......@@ -2502,7 +2502,7 @@ public class Goo
End Function
<WorkItem(544940, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544940")>
<WpfTheory, CombinatorialData>
<WpfTheory(Skip:="https://github.com/dotnet/roslyn/issues/47610"), CombinatorialData>
<Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function LocalFunctionAttributeNamedPropertyCompletionCommitWithTab(showCompletionInArgumentLists As Boolean) As Task
Using state = TestStateFactory.CreateCSharpTestState(
......
......@@ -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)
{
......
......@@ -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
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -86,6 +86,12 @@ public ImmutableArray<TextSpan> 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();
......
......@@ -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";
......
......@@ -41,7 +41,6 @@
<ItemGroup>
<Compile Include="..\..\..\VisualStudio\Core\Def\Implementation\Watson\WatsonExtensions.cs" Link="Services\WorkspaceTelemetry\WatsonExtensions.cs" />
<Compile Include="..\..\..\VisualStudio\Core\Def\Implementation\Watson\WatsonReporter.cs" Link="Services\WorkspaceTelemetry\WatsonReporter.cs" />
<Compile Include="..\..\..\VisualStudio\Core\Def\Implementation\Watson\WatsonTraceListener.cs" Link="Services\WorkspaceTelemetry\WatsonTraceListener.cs" />
<Compile Include="..\..\..\VisualStudio\Core\Def\Telemetry\VSTelemetryCache.cs" Link="Services\WorkspaceTelemetry\VSTelemetryCache.cs" />
<Compile Include="..\..\..\VisualStudio\Core\Def\Telemetry\VSTelemetryLogger.cs" Link="Services\WorkspaceTelemetry\VSTelemetryLogger.cs" />
<Compile Include="..\..\..\VisualStudio\Core\Def\Telemetry\AbstractWorkspaceTelemetryService.cs" Link="Services\WorkspaceTelemetry\AbstractWorkspaceTelemetryService.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)
......
......@@ -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<JsonConverter>? jsonConverters = null)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册