Exemple #1
0
        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;

            // 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>()));

            this.Initialize();
        }
 internal void RemoveFactory(SnapshotFactory factory)
 {
     sink.RemoveFactory(factory);
 }
 internal void AddFactory(SnapshotFactory factory)
 {
     sink.AddFactory(factory);
 }
Exemple #4
0
 public void RemoveFactory(SnapshotFactory factory)
 {
     sink.RemoveFactory(factory);
 }
Exemple #5
0
 public void AddFactory(SnapshotFactory factory)
 {
     sink.AddFactory(factory);
 }
 public void RemoveFactory(SnapshotFactory factory)
 {
     SafeOperation("RemoveFactory", () => sink.RemoveFactory(factory));
 }
 public void AddFactory(SnapshotFactory factory)
 {
     SafeOperation("AddFactory", () => sink.AddFactory(factory));
 }