I'm not sure that I want to go to the extra trouble of trying to determine the line numbers ahead of time. For this particular application I'm OK with a compromise that gets me most of the way there.

Most of the code files it'll scan will be unit/integration tests files which will look something like this:

Code:
/// <summary>
/// Func description
/// </summary>
/// <param name = "param"> param descriptions... </param>
[Test]
[TestCase("test case params")]
[TestCase("test case params")]
[Some Decorator]
[Some other decorator]
public void MethodName(param param)
{
   (source code)
}

/// <summary>
/// Func description/// </summary>
/// <param name = "param"> param descriptions... </param>
[Test]
[TestCase("test case params")]
[TestCase("test case params")]
[Some Decorator]
[Some other decorator]
public void MethodName(param param)
{
   (source code)
}


What I'd like to do is try a regex which will look for the first "MethodName", then go searching for the next instance of one of the keywords that usually precedes the next MethodName (I'm thinking something along the lines of public|private|protected|internal|sealed or something), then from that point rolling back to the last closing curly brace it found before hitting that keyword. I'm currently having trouble working out that exact syntax in such a way that I can get the git blame command to accept it, mostly because I'm not good at regex yet.
_________________________
Tony Fabris