3 comments
Comment actions Permalink

What are you trying to do? You can use either a "daemon stage process" or element problem analyser to add a "squiggly" underline error/warning highlight in a document, and that will also display in the solution wide error analysis window. Is this what you're after? More details here: http://confluence.jetbrains.com/display/NETCOM/2.04+Daemons+and+Daemon+Stages+%28R8%29

0
Comment actions Permalink

I am developing a visual studio addin. I would like to enumerate resharper issues (warnings/errors) just the way I can enumerate standard VS errors...

0
Comment actions Permalink

OK. ReSharper doesn't maintain a list of errors and warnings unless Solution Wide Error Analysis is enabled. Instead, it calculates it on the fly for open documents, and only keeps visible documents up to date with changes. To get at the SWEA data, you can use SolutionAnalysisManager.IssueSet.

If you want to display the highlights for the current document, you can use IDocumentMarkupManager.GetMarkupModel(document).GetHighlightersEnumerable() and iterate over them. The IDocumentMarkup object returned by GetMarkupModel also has a Changed event to let you know when the highlights have changed, and passes in lists of added, modified and removed highlights. You can use ITextControlManager.VisibleTextControls to get a live observable collection of visible ITextControl, from which you can use the Document property to get an IDocument to pass to GetMarkupModel. Also, when a text control is removed from the collection, it's a notification to remove the event handler from IDocumentMarkup.Changed.

You can also use ReSharper's component model to get a hold of Visual Studio interfaces, so you can probably do this as a ReSharper plugin, rather than a VS addin (for one thing, there's currently no easy way to integrate a VS extension with ReSharper - you'd have to write both a VS extension and a ReSharper extension and manage the integration). However, adding VS specific interfaces to your ReSharper plugin might tie it to a specific Visual Studio version, which affects how it's deployed.

0

Please sign in to leave a comment.