Popup function help after enter ( character

Hi, I would like to show some help for a function after the user types ‘(’ following a valid function name. I can get showHint to work (which I use to suggest function names while typing) but for the function help I want to display a formatted div just below the cursor. I don’t think I can use showHint to display formatted text and I’ve tried using addWidget but can’t seem to get it to do anything and there aren’t enough examples online to show me how to do it. I do already have code that will popup a formatted box at a given position and would happily use that but I can’t seem to figure out how to get the cursor (not mouse) position at the point where the user has typed the (.

Has anyone done something similar ? If so do you have any sample code I could look at.

For that kind of thing it is probably best to overlay some element over the editor. There’s no addon that does this for you but you might be able to base your code on what the tern addon does when showing types or argument lists.

Thanks marijn. The piece is was missing was the cursorCoords method to get the x,y coordinates of the cursor. Using that I was able to use existing code to overlay a div at the given co-ordinates.