I've found a "feature" of the extensibility model that is driving me nuts.
In C# and J#, if you call CreateElementFromPoint from the filecodemodel and
ask for the class for the given point, the routine returns a function if the
point indicated is in a function. This seems pretty bone-headed to me. Am I
missing something? Is this a bug? Is there a good workaround?
Yes, that feature is not reliable yet (in MS words), varying from language
to language.
As workaround you must travel the FileCodeModel from top to down recursively
until you reach the closest code element of the requested kind that contains
the line.

Signature
Carlos J. Quintero (Visual Developer - .NET MVP)
> I've found a "feature" of the extensibility model that is driving me nuts.
> In C# and J#, if you call CreateElementFromPoint from the filecodemodel and
> ask for the class for the given point, the routine returns a function if the
> point indicated is in a function. This seems pretty bone-headed to me. Am I
> missing something? Is this a bug? Is there a good workaround?