I’d like to know if there’s a good way to find the end of a function.
The background is that I’m currently hacking on source code browser. I’d like to display only single functions, I know where they start and wondered if I can use CodeMirror itself to find the line where the functions ends.
I tried it with looping through the lines and getting the information about the indentation with
getStateAfter(), but it doesn’t seems to contain enough information to determine whether the end of the function is reached (and of course the indentation might be wrong). Are there better ways?