Code Inspection API?

Hello,


I'm trying to figure out how to access the code inspection API. I would like to create a Team System Checkin policy that prevents a developer from
checking in code that Resharper has tagged with Inspection errors. I need to pass a file to the resharper code inspection API and retrieve a list of inspection errors.
Can someone point me in the right direction?

4 comments

You'd like to run code analysis agains given file, and then collect all
analysis results?

--
Eugene Pasynkov
ReSharper Technical Lead
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


"Shane Faulkner" <no_reply@jetbrains.com> wrote in message
news:12662919.11541233248337717.JavaMail.clearspace@app4.labs.intellij.net...

Hello,

>
>

I'm trying to figure out how to access the code inspection API. I would
like to create a Team System Checkin policy that prevents a developer from
checking in code that Resharper has tagged with Inspection errors. I need
to pass a file to the resharper code inspection API and retrieve a list of
inspection errors.
Can someone point me in the right direction?

>

---
Original message URL:
http://www.jetbrains.net/devnet/message/5231030#5231030



0

This is exactly what I want to do.

0

1) First of all, you need to override highlighting engine to get access to
analysis result:

public class HighlightingDumper : DaemonProcessBase
{
private readonly List myHighlighters = new List(); public HighlightingDumper(IProjectFile projectFile) : base(projectFile, DaemonStageManager.Instance.VisibleDocumentStages) { } public IList Highlighters { get { return myHighlighters; } } public override void CommitHighlighters(DaemonCommitContext context) { myHighlighters.AddRange(context.HighlightingsToAdd.Where(h => myHighlightingPredicate(h.Highlighting))); foreach (HighlightingInfo highlighting in context.HighlightingsToRemove) { if (myHighlighters.Contains(highlighting)) myHighlighters.Remove(highlighting); } } } 2) Then invoke it: var process = new HighlightingDumper(projectFile); process.DoHighlighting(DaemonProcessKind.VISIBLE_DOCUMENT); -- Eugene Pasynkov ReSharper Technical Lead JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!" "Shane Faulkner" ]]> wrote in message
news:12256926.16631233334228297.JavaMail.clearspace@app4.labs.intellij.net...

This is exactly what I want to do.

>

---
Original message URL:
http://www.jetbrains.net/devnet/message/5231101#5231101



0

Hello Shane,

Hello,

I'm trying to figure out how to access the code inspection API. I
would like to create a Team System Checkin policy that prevents a
developer from

checking in code that Resharper has tagged with Inspection errors. I
need to pass a file to the resharper code inspection API and retrieve
a list of inspection errors.

Can someone point me in the right direction?


Try to use ReSharper plugin ".NET Code Inspector" - http://safedevelop.com/Products/CodeInspector/default.aspx

Best regards,
Alexander Nesterenko
Safe Develop Team


0

Please sign in to leave a comment.