Вопрос

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.

Это было полезно?

Решение

'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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top