Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ugras-ergun-sonarsource committed Nov 28, 2023
1 parent cebdfd3 commit 680c60d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using SonarLint.VisualStudio.Core;
using SonarLint.VisualStudio.Core.Binding;
using SonarLint.VisualStudio.Core.Configuration;
using SonarLint.VisualStudio.Core.Transition;
using SonarLint.VisualStudio.Integration.Transition;
Expand All @@ -35,9 +33,7 @@ public class MuteIssuesWindowServiceTests
public void MefCtor_CheckIsExported()
{
MefTestHelpers.CheckTypeCanBeImported<MuteIssuesWindowService, IMuteIssuesWindowService>(
MefTestHelpers.CreateExport<IConnectedModeFeaturesConfiguration>(),
MefTestHelpers.CreateExport<IConfigurationProvider>(),
MefTestHelpers.CreateExport<ILogger>());
MefTestHelpers.CreateExport<IConnectedModeFeaturesConfiguration>());
}
}
}
9 changes: 0 additions & 9 deletions src/Integration/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/Integration/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,4 @@ This is the general format to use when writing errors to output window or when t
<data name="MuteWindow_WontFixTitle" xml:space="preserve">
<value>Won't Fix</value>
</data>
<data name="MuteIssuesWindowService_NotInConnectedMode" xml:space="preserve">
<value>[MuteIssuesWindowService] You can mute issues only in Connected mode</value>
</data>
</root>
15 changes: 1 addition & 14 deletions src/Integration/Transition/MuteIssuesWindowService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
using System.ComponentModel.Composition;
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using SonarLint.VisualStudio.Core;
using SonarLint.VisualStudio.Core.Binding;
using SonarLint.VisualStudio.Core.Configuration;
using SonarLint.VisualStudio.Core.Transition;
using SonarLint.VisualStudio.Integration.Resources;

namespace SonarLint.VisualStudio.Integration.Transition
{
Expand All @@ -34,26 +31,16 @@ namespace SonarLint.VisualStudio.Integration.Transition
internal class MuteIssuesWindowService : IMuteIssuesWindowService
{
private readonly IConnectedModeFeaturesConfiguration connectedModeFeaturesConfiguration;
private readonly IConfigurationProvider configurationProvider;
private readonly ILogger logger;

[ImportingConstructor]
public MuteIssuesWindowService(IConnectedModeFeaturesConfiguration connectedModeFeaturesConfiguration, IConfigurationProvider configurationProvider, ILogger logger)
public MuteIssuesWindowService(IConnectedModeFeaturesConfiguration connectedModeFeaturesConfiguration)
{
this.connectedModeFeaturesConfiguration = connectedModeFeaturesConfiguration;
this.configurationProvider = configurationProvider;
this.logger = logger;
}

[ExcludeFromCodeCoverage]
public MuteIssuesWindowResponse Show(string issueKey)
{
if (!configurationProvider.GetConfiguration().Mode.IsInAConnectedMode())
{
logger.LogVerbose(Strings.MuteIssuesWindowService_NotInConnectedMode);
return null;
}

var dialog = new MuteWindowDialog(connectedModeFeaturesConfiguration.IsNewCctAvailable());
dialog.Owner = Application.Current.MainWindow;
var dialogResult = dialog.ShowDialog();
Expand Down

0 comments on commit 680c60d

Please sign in to comment.