2

I'm writing a plugin for ReSharper 7, and I'd like to be able to use Call Tracking from inside my plugin. I haven't come across anything in the SDK that lets me do this, is it possible at all?

Specifically, I want to be able to get the "incoming calls" and "outgoing calls" of a method from inside my IRecursiveElementProcessor.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Wilka
  • 28,701
  • 14
  • 75
  • 97

1 Answers1

1

'Call Tracking' in ReSharper a user-end feature but not a generic engine for use in other features. Basically it uses two APIes - Find Usages and Resolve. To find usages (calls) to your method or property you must use IPsiServices:Finder and to find methods and properties that are called from given code block you must process it's syntax tree with RecursiveElementProcessor, ask for references for each tree node ITreeNode:GetReferences() and resolve each reference using IReference:Resolve. Basic interfaces that you use should for these operations are: ITreeNode IReference IDeclaredElement IDeclaration

Shkredov S.
  • 2,097
  • 16
  • 8