public void RemoveIssueTracker(IssueTracker tracker) { lock (managers) { trackers.Remove(tracker); foreach (var manager in managers) { manager.RemoveFactory(tracker.Factory); } } }
public void AddIssueTracker(IssueTracker tracker) { lock (managers) { trackers.Add(tracker); foreach (var manager in managers) { manager.AddFactory(tracker.Factory); } } }
/// <summary> /// Create a tagger that will track Sonar issues on the view/buffer combination. /// </summary> public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag { if (!daemon.IsRunning) { return(null); } // Only attempt to track the view's edit buffer. // Multiple views could have that buffer open simultaneously, so only create one instance of the tracker. if (buffer != textView.TextBuffer || typeof(T) != typeof(IErrorTag)) { return(null); } ITextDocument document; if (!TextDocumentFactoryService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out document)) { return(null); } var path = document.FilePath; // TODO find a better way to detect JavaScript if (!path.ToLowerInvariant().EndsWith(".js")) { return(null); } lock (trackers) { if (!trackers.ExistsForFile(path)) { var tracker = new IssueTracker(this, buffer, document); return(tracker as ITagger <T>); } } return(null); }
public bool TryGetValue(string path, out IssueTracker tracker) { return(trackers.TryGetValue(Key(path), out tracker)); }
public void Remove(IssueTracker tracker) { trackers.Remove(Key(tracker.FilePath)); }
public void Add(IssueTracker tracker) { trackers.Add(Key(tracker.FilePath), tracker); }