예제 #1
0
        internal TextBufferIssueTracker(DTE dte, TaggerProvider provider, ITextDocument document,
                                        IEnumerable <AnalysisLanguage> detectedLanguages, IIssueConverter issueConverter, ILogger logger, IIssuesFilter issuesFilter)
        {
            this.dte = dte;

            this.Provider        = provider;
            this.textBuffer      = document.TextBuffer;
            this.currentSnapshot = document.TextBuffer.CurrentSnapshot;

            this.detectedLanguages = detectedLanguages;
            this.issueConverter    = issueConverter;
            this.logger            = logger;
            this.issuesFilter      = issuesFilter;

            this.document = document;
            this.FilePath = document.FilePath;

            this.ProjectItem = dte.Solution.FindProjectItem(this.FilePath);
            this.charset     = document.Encoding.WebName;

            // Bug #676: https://github.com/SonarSource/sonarlint-visualstudio/issues/676
            // It's possible to have a ProjectItem that doesn't have a ContainingProject
            // e.g. files under the "External Dependencies" project folder in the Solution Explorer
            var projectName = this.ProjectItem?.ContainingProject.Name ?? "{none}";

            this.Factory = new SnapshotFactory(new IssuesSnapshot(projectName, this.FilePath, 0,
                                                                  new List <IssueMarker>()));

            document.FileActionOccurred += SafeOnFileActionOccurred;
        }
예제 #2
0
        internal SinkManager(TaggerProvider taggerProvider, ITableDataSink sink)
        {
            this.taggerProvider = taggerProvider;
            this.sink           = sink;

            taggerProvider.AddSinkManager(this);
        }
        public TextBufferIssueTracker(DTE dte, TaggerProvider provider, ITextDocument document,
                                      IEnumerable <AnalysisLanguage> detectedLanguages, IIssuesFilter issuesFilter,
                                      ISonarErrorListDataSource sonarErrorDataSource, IAnalysisIssueVisualizationConverter converter,
                                      IVsSolution5 vsSolution, ILogger logger)
        {
            this.dte = dte;

            this.Provider   = provider;
            this.textBuffer = document.TextBuffer;

            this.detectedLanguages    = detectedLanguages;
            this.sonarErrorDataSource = sonarErrorDataSource;
            this.converter            = converter;
            this.vsSolution           = vsSolution;
            this.logger       = logger;
            this.issuesFilter = issuesFilter;

            this.document = document;
            this.FilePath = document.FilePath;
            this.charset  = document.Encoding.WebName;

            this.Factory = new IssuesSnapshotFactory(new IssuesSnapshot(GetProjectName(), GetProjectGuid(), FilePath, new List <IAnalysisIssueVisualization>()));

            document.FileActionOccurred += SafeOnFileActionOccurred;

            sonarErrorDataSource.AddFactory(this.Factory);
            Provider.AddIssueTracker(this);

            RequestAnalysis(null /* no options */);
        }
예제 #4
0
        internal IssueTracker(TaggerProvider provider, ITextBuffer buffer, ITextDocument document)
        {
            this.provider        = provider;
            this.textBuffer      = buffer;
            this.currentSnapshot = buffer.CurrentSnapshot;
            this.dirtySpans      = new NormalizedSnapshotSpanCollection();

            this.document = document;
            this.FilePath = document.FilePath;
            this.Charset  = document.Encoding.WebName;
            this.Factory  = new SnapshotFactory(new IssuesSnapshot(this.FilePath, 0, new List <IssueMarker>()));

            this.Initialize();
        }
        internal IssueTagger(_DTE dte, TaggerProvider provider, ITextBuffer buffer, ITextDocument document, IList <IContentType> contentTypes)
        {
            this.dte             = dte;
            this.provider        = provider;
            this.textBuffer      = buffer;
            this.contentTypes    = contentTypes;
            this.currentSnapshot = buffer.CurrentSnapshot;
            this.dirtySpans      = new NormalizedSnapshotSpanCollection();

            this.document    = document;
            this.FilePath    = document.FilePath;
            this.ProjectItem = dte.Solution.FindProjectItem(this.FilePath);
            this.Charset     = document.Encoding.WebName;
            this.Factory     = new SnapshotFactory(new IssuesSnapshot(this.ProjectItem.ContainingProject.Name, this.FilePath, 0, new List <IssueMarker>()));

            this.Initialize();
        }
        internal IssueTagger(DTE dte, TaggerProvider provider, ITextBuffer buffer, ITextDocument document,
                             IEnumerable <SonarLanguage> detectedLanguages, IIssueConverter issueConverter)
        {
            this.dte               = dte;
            this.provider          = provider;
            this.textBuffer        = buffer;
            this.detectedLanguages = detectedLanguages;
            this.issueConverter    = issueConverter;
            this.currentSnapshot   = buffer.CurrentSnapshot;
            this.dirtySpans        = new NormalizedSnapshotSpanCollection();

            this.document    = document;
            this.FilePath    = document.FilePath;
            this.ProjectItem = dte.Solution.FindProjectItem(this.FilePath);
            this.Charset     = document.Encoding.WebName;
            this.Factory     = new SnapshotFactory(new IssuesSnapshot(this.ProjectItem.ContainingProject.Name, this.FilePath, 0,
                                                                      new List <IssueMarker>()));

            this.Initialize();
        }
예제 #7
0
 public TextBufferIssueTracker(DTE dte, TaggerProvider provider, ITextDocument document,
                               IEnumerable <AnalysisLanguage> detectedLanguages, ILogger logger, IIssuesFilter issuesFilter)
     : this(dte, provider, document, detectedLanguages, new IssueConverter(), logger, issuesFilter)
 {
 }
 internal IssueTagger(DTE dte, TaggerProvider provider, ITextBuffer buffer, ITextDocument document,
                      IEnumerable <SonarLanguage> detectedLanguages)
     : this(dte, provider, buffer, document, detectedLanguages, new IssueConverter())
 {
 }