public OpenInIDERequestHandler(
     IIDEWindowService ideWindowService,
     IToolWindowService toolWindowService,
     IOpenInIDEStateValidator ideStateValidator,
     ISonarQubeService sonarQubeService,
     IHotspotToIssueVisualizationConverter converter,
     ILocationNavigator navigator,
     IHotspotsStore hotspotsStore,
     IOpenInIDEFailureInfoBar failureInfoBar,
     IIssueSelectionService issueSelectionService,
     ITelemetryManager telemetryManager,
     ILogger logger)
 {
     // MEF-created so the arguments should never be null
     this.ideWindowService      = ideWindowService;
     this.toolWindowService     = toolWindowService;
     this.ideStateValidator     = ideStateValidator;
     this.sonarQubeService      = sonarQubeService;
     this.converter             = converter;
     this.navigator             = navigator;
     this.hotspotsStore         = hotspotsStore;
     this.failureInfoBar        = failureInfoBar;
     this.issueSelectionService = issueSelectionService;
     this.telemetryManager      = telemetryManager;
     this.logger = logger;
 }
Ejemplo n.º 2
0
        private static TaintIssuesSynchronizer CreateTestSubject(ITaintStore taintStore = null,
                                                                 ITaintIssueToIssueVisualizationConverter converter = null,
                                                                 ILogger logger                       = null,
                                                                 SonarLintMode mode                   = SonarLintMode.Connected,
                                                                 ISonarQubeService sonarService       = null,
                                                                 IVsMonitorSelection vsMonitor        = null,
                                                                 IToolWindowService toolWindowService = null)
        {
            taintStore ??= Mock.Of <ITaintStore>();
            converter ??= Mock.Of <ITaintIssueToIssueVisualizationConverter>();

            var serviceProvider = CreateServiceProvider(vsMonitor);

            var configurationProvider = new Mock <IConfigurationProvider>();

            configurationProvider
            .Setup(x => x.GetConfiguration())
            .Returns(new BindingConfiguration(new BoundSonarQubeProject {
                ProjectKey = SharedProjectKey
            }, mode, ""));

            sonarService ??= CreateSonarService().Object;
            toolWindowService ??= Mock.Of <IToolWindowService>();

            logger ??= Mock.Of <ILogger>();

            return(new TaintIssuesSynchronizer(taintStore, sonarService, converter, configurationProvider.Object,
                                               toolWindowService, serviceProvider, logger));
        }
        internal IssueVisualizationToolWindowCommand(IToolWindowService toolWindowService, IMenuCommandService commandService, IVsMonitorSelection monitorSelection, ILogger logger)
        {
            this.toolWindowService = toolWindowService ?? throw new ArgumentNullException(nameof(toolWindowService));
            this.monitorSelection  = monitorSelection ?? throw new ArgumentNullException(nameof(monitorSelection));
            this.logger            = logger ?? throw new ArgumentNullException(nameof(logger));

            if (commandService == null)
            {
                throw new ArgumentNullException(nameof(commandService));
            }

            var menuCommandId = new CommandID(CommandSet, ViewToolWindowCommandId);
            var menuItem      = new MenuCommand(Execute, menuCommandId);

            commandService.AddCommand(menuItem);

            menuCommandId = new CommandID(CommandSet, ErrorListCommandId);
            // We're showing the command in two places in the UI, but we only do a status check when it's called from the Error List context menu.
            ErrorListMenuItem = new OleMenuCommand(Execute, null, ErrorListQueryStatus, menuCommandId);
            commandService.AddCommand(ErrorListMenuItem);

            var uiContextGuid = new Guid(Constants.UIContextGuid);

            monitorSelection.GetCmdUIContextCookie(ref uiContextGuid, out uiContextCookie);
        }
        public VsViewLocatorService(IToolWindowService toolWindowService, ILoggingService loggingService, IServiceProvider serviceProvider)
        {
            ServiceProvider = serviceProvider;
            var lastIndex = typeof(VsViewLocatorService).Namespace.LastIndexOf('.');

            _viewNamespace     = typeof(VsViewLocatorService).Namespace.Substring(0, lastIndex) + ".Views"; // Tanzu.Toolkit.VisualStudio.Services -> Tanzu.Toolkit.VisualStudio.Views
            _toolWindowService = toolWindowService;
            _logger            = loggingService.Logger;
        }
Ejemplo n.º 5
0
        internal ShowToolWindowCommand(CommandID commandId, Guid toolWindowId,
                                       IToolWindowService toolWindowService, IMenuCommandService commandService, ILogger logger)
        {
            this.toolWindowId = toolWindowId;

            this.toolWindowService = toolWindowService ?? throw new ArgumentNullException(nameof(toolWindowService));
            this.logger            = logger ?? throw new ArgumentNullException(nameof(logger));

            if (commandService == null)
            {
                throw new ArgumentNullException(nameof(commandService));
            }

            var menuItem = new MenuCommand(Execute, commandId);

            commandService.AddCommand(menuItem);
        }
Ejemplo n.º 6
0
        public TaintIssuesSynchronizer(ITaintStore taintStore,
                                       ISonarQubeService sonarQubeService,
                                       ITaintIssueToIssueVisualizationConverter converter,
                                       IConfigurationProvider configurationProvider,
                                       IToolWindowService toolWindowService,
                                       [Import(typeof(VSShell.SVsServiceProvider))] IServiceProvider serviceProvider,
                                       ILogger logger)
        {
            this.taintStore            = taintStore;
            this.sonarQubeService      = sonarQubeService;
            this.converter             = converter;
            this.configurationProvider = configurationProvider;
            this.toolWindowService     = toolWindowService;
            this.logger = logger;

            vsMonitorSelection = (VSShellInterop.IVsMonitorSelection)serviceProvider.GetService(typeof(VSShellInterop.SVsShellMonitorSelection));
            Guid localGuid = TaintIssuesExistUIContext.Guid;

            vsMonitorSelection.GetCmdUIContextCookie(ref localGuid, out contextCookie);
        }
Ejemplo n.º 7
0
 public TestVsViewLocatorService(IToolWindowService toolWindowService, ILoggingService loggingService, IServiceProvider serviceProvider) : base(toolWindowService, loggingService, serviceProvider)
 {
     var defaultTypeLookupOverrides = new Dictionary <string, Type>
     {
     };
 }
 public OutputWindowService([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
                            IToolWindowService toolWindowService)
 {
     this.serviceProvider   = serviceProvider;
     this.toolWindowService = toolWindowService;
 }