示例#1
0
        public TaggerProvider(
            [Import] ITableManagerProvider tableManagerProvider,
            [Import] ITextDocumentFactoryService textDocumentFactoryService,
            [Import] IVisualLinterOptions options,
            [Import] ILinter linter)
        {
            _tableManager = tableManagerProvider
                            .GetTableManager(StandardTables.ErrorsTable);

            _textDocumentFactoryService = textDocumentFactoryService;

            _linter = linter;

            _optionsMap.Add(".html", () => options.EnableHtmlLanguageSupport);
            _optionsMap.Add(".js", () => options.EnableJavaScriptLanguageSupport);
            _optionsMap.Add(".jsx", () => options.EnableReactLanguageSupport);
            _optionsMap.Add(".vue", () => options.EnableVueLanguageSupport);

            var columns = new[]
            {
                StandardTableColumnDefinitions.BuildTool,
                StandardTableColumnDefinitions.Column,
                StandardTableColumnDefinitions.DetailsExpander,
                StandardTableColumnDefinitions.DocumentName,
                StandardTableColumnDefinitions.ErrorCategory,
                StandardTableColumnDefinitions.ErrorCode,
                StandardTableColumnDefinitions.ErrorSeverity,
                StandardTableColumnDefinitions.ErrorSource,
                StandardTableColumnDefinitions.Line,
                StandardTableColumnDefinitions.Text
            };

            _tableManager.AddSource(this, columns);
        }
        internal TaggerProvider(ITableManagerProvider provider,
                                ITextDocumentFactoryService textDocumentFactoryService,
                                IContentTypeRegistryService contentTypeRegistryService,
                                IFileExtensionRegistryService fileExtensionRegistryService,
                                ISonarLintDaemon daemon,
                                SVsServiceProvider serviceProvider,
                                ISonarLintSettings settings)
        {
            this.ErrorTableManager            = provider.GetTableManager(StandardTables.ErrorsTable);
            this.TextDocumentFactoryService   = textDocumentFactoryService;
            this.ContentTypeRegistryService   = contentTypeRegistryService;
            this.FileExtensionRegistryService = fileExtensionRegistryService;

            this.ErrorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                             StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName,
                                             StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column,
                                             StandardTableColumnDefinitions.ProjectName);

            this.daemon   = daemon;
            this.dte      = (_DTE)serviceProvider.GetService(typeof(_DTE));
            this.settings = settings;
        }
        internal TaggerProvider(ITableManagerProvider tableManagerProvider,
                                ITextDocumentFactoryService textDocumentFactoryService,
                                ISonarLintDaemon daemon,
                                [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
                                ISonarLintSettings settings,
                                ISonarLanguageRecognizer languageRecognizer,
                                ILogger logger)
        {
            this.errorTableManager          = tableManagerProvider.GetTableManager(StandardTables.ErrorsTable);
            this.textDocumentFactoryService = textDocumentFactoryService;

            this.errorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                             StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName,
                                             StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column,
                                             StandardTableColumnDefinitions.ProjectName);

            this.daemon             = daemon;
            this.dte                = serviceProvider.GetService <DTE>();
            this.settings           = settings;
            this.languageRecognizer = languageRecognizer;
            this.logger             = logger;
        }
示例#4
0
        protected AbstractTable(Workspace workspace, ITableManagerProvider provider, string tableIdentifier)
        {
            _workspace = workspace;
            _provider = provider;

            this.TableManager = provider.GetTableManager(tableIdentifier);
        }
示例#5
0
        public XamlErrorTagger(
            ITableManagerProvider tableManagerProvider,
            ITextBuffer buffer,
            ITextStructureNavigator navigator,
            PreviewerProcess process)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            _buffer                = buffer;
            _navigator             = navigator;
            _process               = process;
            _process.ErrorChanged += HandleErrorChanged;
            _error = process.Error;

            // Get the document path and containing project name.
            var document = GetDocument(buffer);

            _path        = document?.FilePath;
            _projectName = GetProject(_path)?.Name;

            // Register ourselves with the error list.
            var tableManager = tableManagerProvider.GetTableManager(StandardTables.ErrorsTable);

            tableManager.AddSource(this,
                                   StandardTableColumnDefinitions.Column,
                                   StandardTableColumnDefinitions.DocumentName,
                                   StandardTableColumnDefinitions.ErrorSeverity,
                                   StandardTableColumnDefinitions.Line,
                                   StandardTableColumnDefinitions.Text);
        }
示例#6
0
        internal TaggerProvider(ITableManagerProvider tableManagerProvider,
                                ITextDocumentFactoryService textDocumentFactoryService,
                                IIssuesFilter issuesFilter,
                                IAnalyzerController analyzerController,
                                [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
                                ISonarLanguageRecognizer languageRecognizer,
                                IAnalysisRequester analysisRequester,
                                ILogger logger,
                                IScheduler scheduler)
        {
            this.errorTableManager          = tableManagerProvider.GetTableManager(StandardTables.ErrorsTable);
            this.textDocumentFactoryService = textDocumentFactoryService;
            this.issuesFilter = issuesFilter;

            this.errorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                             StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName,
                                             StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column,
                                             StandardTableColumnDefinitions.ProjectName);

            this.analyzerController = analyzerController;
            this.dte = serviceProvider.GetService <DTE>();
            this.languageRecognizer = languageRecognizer;
            this.logger             = logger;
            this.scheduler          = scheduler;

            vsStatusBar = serviceProvider.GetService(typeof(IVsStatusbar)) as IVsStatusbar;
            analysisRequester.AnalysisRequested += OnAnalysisRequested;
        }
示例#7
0
        protected AbstractTable(Workspace workspace, ITableManagerProvider provider, string tableIdentifier)
        {
            _workspace = workspace;
            _provider  = provider;

            this.TableManager = provider.GetTableManager(tableIdentifier);
        }
 internal ErrorListProvider(ITableManagerProvider provider)
 {
     ErrorTableManager = provider.GetTableManager(StandardTables.ErrorsTable);
     ErrorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander, StandardTableColumnDefinitions.ProjectName,
                                 StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                 StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                 StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName,
                                 StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column);
 }
示例#9
0
        internal ErrorHighLightProvider([Import] ITableManagerProvider provider, [Import] ITextDocumentFactoryService textDocumentFactoryService)
        {
            this.ErrorTableManager          = provider.GetTableManager(StandardTables.ErrorsTable);
            this.TextDocumentFactoryService = textDocumentFactoryService;

            this.ErrorTableManager.AddSource(this, StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName, StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column);
        }
示例#10
0
        protected AbstractTable(Workspace workspace, ITableManagerProvider provider, Guid tableIdentifier, AbstractTableDataSource <TArgs, TData> source)
        {
            _workspace        = workspace;
            _provider         = provider;
            this.TableManager = provider.GetTableManager(tableIdentifier);

            this.Source = source;

            AddInitialTableSource(workspace);
        }
示例#11
0
        public UnusedReferencesTableProvider(
            ITableManagerProvider tableMangerProvider,
            IWpfTableControlProvider tableControlProvider)
        {
            _tableManager         = tableMangerProvider.GetTableManager(UnusedReferencesDataSource.Name);
            _tableControlProvider = tableControlProvider;

            _dataSource = new UnusedReferencesDataSource();
            _tableManager.AddSource(_dataSource, UnusedReferencesColumnDefinitions.ColumnNames);
        }
 protected SettingsViewModelBase(ISettingsProvider <T> data,
                                 IWpfTableControlProvider controlProvider,
                                 ITableManagerProvider tableMangerProvider)
 {
     _data            = data;
     _controlProvider = controlProvider;
     _data.RegisterViewModel(this);
     _tableManager    = tableMangerProvider.GetTableManager(Identifier);
     _snapshotFactory = CreateSnapshotFactory(_data);
     _ = _tableManager.AddSource(this);
 }
示例#13
0
        protected CompilationTaggerProvider(ITableManagerProvider provider, ITextDocumentFactoryService textDocumentFactoryService,
                                            IClassificationTypeRegistryService classificationRegistryService)
        {
            this.ErrorTableManager             = provider.GetTableManager(StandardTables.ErrorsTable);
            this.TextDocumentFactoryService    = textDocumentFactoryService;
            this.ClassificationRegistryService = classificationRegistryService;

            this.ErrorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                             StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName, StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column);
        }
示例#14
0
        internal DevSkimProvider([Import] ITableManagerProvider provider, [Import] ITextDocumentFactoryService textDocumentFactoryService, [Import] IClassifierAggregatorService classifierAggregatorService)
        {
            this.ErrorTableManager          = provider.GetTableManager(StandardTables.ErrorsTable);
            this.TextDocumentFactoryService = textDocumentFactoryService;

            this.ClassifierAggregatorService = classifierAggregatorService;

            this.ErrorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                             StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName, StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column);
        }
示例#15
0
        private TableDataSource()
        {
            var compositionService = ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel)) as IComponentModel;

            compositionService.DefaultCompositionService.SatisfyImportsOnce(this);

            var manager = TableManagerProvider.GetTableManager(StandardTables.ErrorsTable);

            manager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                              StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                              StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                              StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                              StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName, StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column);
        }
示例#16
0
        internal TaggerProvider([Import] ITableManagerProvider provider, [Import] ITextDocumentFactoryService textDocumentFactoryService, [Import] ISonarLintDaemon daemon)
        {
            this.ErrorTableManager          = provider.GetTableManager(StandardTables.ErrorsTable);
            this.TextDocumentFactoryService = textDocumentFactoryService;

            this.ErrorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                             StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName,
                                             StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column,
                                             StandardTableColumnDefinitions.ProjectName);

            this.daemon = daemon;
        }
示例#17
0
        public BindingPaneControl(IServiceProvider serviceProvider, BindingPaneViewModel viewModel)
        {
            IComponentModel          componentModel       = serviceProvider.GetService <SComponentModel, IComponentModel>();
            ITableManagerProvider    tableManagerProvider = componentModel.GetService <ITableManagerProvider>();
            IWpfTableControlProvider tableControlProvider = componentModel.GetService <IWpfTableControlProvider>();

            this.ViewModel       = viewModel;
            this.tableDataSource = new TableDataSource(this.ViewModel.Entries);
            this.tableManager    = tableManagerProvider.GetTableManager(Constants.TableManagerString);
            this.tableManager.AddSource(this.tableDataSource, ColumnNames.DefaultSet.ToArray());
            this.TableControl = tableControlProvider.CreateControl(this.tableManager, true,
                                                                   ColumnNames.DefaultSet.Select(n => new ColumnState2(n, isVisible: true, width: 0)),
                                                                   ColumnNames.DefaultSet.ToArray());

            this.InitializeComponent();

            this.tableHolder.Child = this.TableControl.Control;
        }
示例#18
0
        public ErrorsTableDataSource(
            ITableManagerProvider tableManagerProvider,
            VisualStudioWorkspace workspace)
        {
            _workspace = workspace;

            var manager = tableManagerProvider.GetTableManager(StandardTables.ErrorsTable);

            manager.AddSource(
                this,
                StandardTableColumnDefinitions.Column,
                StandardTableColumnDefinitions.Line,
                StandardTableColumnDefinitions.DocumentName,
                StandardTableColumnDefinitions.ErrorCode,
                StandardTableColumnDefinitions.ErrorSeverity,
                StandardTableColumnDefinitions.ErrorSource,
                StandardTableColumnDefinitions.Text);
        }
示例#19
0
        internal HighlightInvalidKeyrefTaggerProvider([Import] ITableManagerProvider provider, [Import] ITextDocumentFactoryService textDocumentFactoryService, [Import] IClassifierAggregatorService classifierAggregatorService)
        {
            this.ErrorTableManager          = provider.GetTableManager(StandardTables.ErrorsTable);
            this.TextDocumentFactoryService = textDocumentFactoryService;

            // this.ClassifierAggregatorService = classifierAggregatorService;

            this.ErrorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                             StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName,
                                             StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column);

            if (Debugger.IsAttached)
            {
                AppDomain.CurrentDomain.FirstChanceException += (sender, ea) => Debug.Print(ea.Exception.ToString());
            }
        }
示例#20
0
        internal SonarErrorListDataSource(ITableManagerProvider tableManagerProvider,
                                          IFileRenamesEventSource fileRenamesEventSource,
                                          IIssueSelectionService issueSelectionService)
        {
            if (tableManagerProvider == null)
            {
                throw new ArgumentNullException(nameof(tableManagerProvider));
            }

            this.fileRenamesEventSource          = fileRenamesEventSource ?? throw new ArgumentNullException(nameof(fileRenamesEventSource));
            this.issueSelectionService           = issueSelectionService ?? throw new ArgumentNullException(nameof(issueSelectionService));
            fileRenamesEventSource.FilesRenamed += OnFilesRenamed;

            var errorTableManager = tableManagerProvider.GetTableManager(StandardTables.ErrorsTable);

            errorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                        StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                        StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                        StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                        StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName,
                                        StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column,
                                        StandardTableColumnDefinitions.ProjectName);
        }
示例#21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TableManagerDiagnosticsProvider"/> class.
 /// </summary>
 /// <param name="tableManagerProvider">The <see cref="ITableManagerProvider"/>.</param>
 public TableManagerDiagnosticsProvider(ITableManagerProvider tableManagerProvider)
 {
     _tableManager = tableManagerProvider.GetTableManager(StandardTables.ErrorsTable);
     _tableManager.SourcesChanged += DataSourcesChanged;
     SubscribeToNewSources();
 }