Am looking to generate a list of all class/function names in the current document, which, when clicked on will jump to that line in the file.
Currently using cm.eachLine and getting handle, then performing an indexOf(‘class’) and indexOf(‘function’) on ‘text’ returned in the handle. This works OK, but of course it’s not perfect as it’ll pick up false positives for those words appearing in places where it’s not declaring a class or function.
Is there a more reliable way to only identify lines that are truly initialising a class/function? Ideally I’d like to also pick up the arguments on them also.