Skip to content

Commit 347cd02

Browse files
authored
Refactor and simplify (#59981)
1 parent c831c66 commit 347cd02

23 files changed

Lines changed: 196 additions & 369 deletions

src/EditorFeatures/CSharpTest/CodeActions/Preview/PreviewExceptionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Microsoft.CodeAnalysis.Editor.Implementation.Suggestions;
1414
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
1515
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
16+
using Microsoft.CodeAnalysis.ErrorReporting;
1617
using Microsoft.CodeAnalysis.Extensions;
1718
using Microsoft.CodeAnalysis.Test.Utilities;
1819
using Microsoft.CodeAnalysis.Text;

src/EditorFeatures/Core/Workspaces/EditorErrorReportingService.cs renamed to src/EditorFeatures/Core/ErrorReporting/EditorErrorReportingService.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
using Microsoft.CodeAnalysis.Extensions;
6+
using System.Composition;
7+
using Microsoft.CodeAnalysis.Host.Mef;
78
using Microsoft.CodeAnalysis.Internal.Log;
89
using Microsoft.CodeAnalysis.Telemetry;
910

10-
namespace Microsoft.CodeAnalysis.Editor.Implementation.Workspaces
11+
namespace Microsoft.CodeAnalysis.ErrorReporting
1112
{
12-
internal class EditorErrorReportingService : IErrorReportingService
13+
[ExportWorkspaceService(typeof(IErrorReportingService), ServiceLayer.Editor), Shared]
14+
internal sealed class EditorErrorReportingService : IErrorReportingService
1315
{
16+
[ImportingConstructor]
17+
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
18+
public EditorErrorReportingService()
19+
{
20+
}
21+
1422
public string HostDisplayName => "host";
1523

1624
public void ShowDetailedErrorInfo(Exception exception)

src/EditorFeatures/Core/Extensions/EditorLayerExtensionManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Microsoft.CodeAnalysis.CodeRefactorings;
1111
using Microsoft.CodeAnalysis.Editor.Options;
1212
using Microsoft.CodeAnalysis.ErrorLogger;
13+
using Microsoft.CodeAnalysis.ErrorReporting;
1314
using Microsoft.CodeAnalysis.Extensions;
1415
using Microsoft.CodeAnalysis.Host;
1516
using Microsoft.CodeAnalysis.Host.Mef;

src/EditorFeatures/Core/InfoBar/EditorInfoBarService.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/EditorFeatures/Core/Workspaces/EditorErrorReportingServiceFactory.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/EditorFeatures/Test/CodeFixes/CodeFixServiceTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics;
1515
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
1616
using Microsoft.CodeAnalysis.ErrorLogger;
17+
using Microsoft.CodeAnalysis.ErrorReporting;
1718
using Microsoft.CodeAnalysis.Extensions;
1819
using Microsoft.CodeAnalysis.Host.Mef;
1920
using Microsoft.CodeAnalysis.PooledObjects;

src/EditorFeatures/Test/CodeRefactorings/CodeRefactoringServiceTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Microsoft.CodeAnalysis.CodeRefactorings;
1313
using Microsoft.CodeAnalysis.Diagnostics;
1414
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
15+
using Microsoft.CodeAnalysis.ErrorReporting;
1516
using Microsoft.CodeAnalysis.Extensions;
1617
using Microsoft.CodeAnalysis.Test.Utilities;
1718
using Microsoft.CodeAnalysis.Text;

src/Features/Core/Portable/CodeFixes/CodeFixService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Microsoft.CodeAnalysis.CodeFixes.Suppression;
1717
using Microsoft.CodeAnalysis.Diagnostics;
1818
using Microsoft.CodeAnalysis.ErrorLogger;
19+
using Microsoft.CodeAnalysis.ErrorReporting;
1920
using Microsoft.CodeAnalysis.Extensions;
2021
using Microsoft.CodeAnalysis.Host.Mef;
2122
using Microsoft.CodeAnalysis.Internal.Log;

src/VisualStudio/Core/Def/Workspace/DetailedErrorInfoDialog.xaml renamed to src/VisualStudio/Core/Def/ErrorReporting/DetailedErrorInfoDialog.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<ui:DialogWindow x:Class="Microsoft.VisualStudio.LanguageServices.Implementation.DetailedErrorInfoDialog"
1+
<ui:DialogWindow x:Class="Microsoft.CodeAnalysis.ErrorReporting.DetailedErrorInfoDialog"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
44
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
5-
xmlns:local="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation"
5+
xmlns:local="clr-namespace:Microsoft.CodeAnalysis.ErrorReporting"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
xmlns:ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
88
xmlns:vs="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"

src/VisualStudio/Core/Def/Workspace/DetailedErrorInfoDialog.xaml.cs renamed to src/VisualStudio/Core/Def/ErrorReporting/DetailedErrorInfoDialog.xaml.cs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,12 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
using System;
8-
using System.Collections.Generic;
9-
using System.Linq;
10-
using System.Text;
11-
using System.Threading.Tasks;
126
using System.Windows;
13-
using System.Windows.Controls;
14-
using System.Windows.Data;
15-
using System.Windows.Documents;
16-
using System.Windows.Forms;
17-
using System.Windows.Input;
18-
using System.Windows.Media;
19-
using System.Windows.Media.Imaging;
20-
using System.Windows.Navigation;
21-
using System.Windows.Shapes;
7+
using Microsoft.VisualStudio.LanguageServices;
228
using Microsoft.VisualStudio.PlatformUI;
23-
using Microsoft.VisualStudio.Shell;
249

25-
namespace Microsoft.VisualStudio.LanguageServices.Implementation
10+
namespace Microsoft.CodeAnalysis.ErrorReporting
2611
{
2712
internal partial class DetailedErrorInfoDialog : DialogWindow
2813
{

0 commit comments

Comments
 (0)