Search code examples
tfstfvc

How to programmatically get method level history from TFS API?


I am trying to find out method level history from TFS. I am able to get the history (associated work items and changesets) for an item, but unable to do the same at method level. The intent is to find the work items and changesets linked with a method in class. Any pointers to accomplish this would be highly helpful.


Solution

  • This is implemented in the CodeLens API's which are not exposed publicly. Source control in itself doesn't have a semantic concept of the contents of the file. The Code Lens API uses Roslyn to parse the files and uses clever heuristics to link different versions of the same method to each other.

    Given that CodeLens API's aren't available for public use, TFS doesn't have anything that will help you accomplish this, without re-building the heuristic+semantic processing that CodeLens provides.