Retrieve the eldoc string synchronously

Complete rewrite of #371