It seems the source
argument in hoverTooltip
, when called, is expected to return Tooltip | null
.
This works fine when the contents and precise position of the Tooltip is known immediately. However, when trying to fetch the documentation of the hovered symbol from a Language Server, it requires a round trip.
Would it be too much work to also allow a return of Promise<Tooltip>
from this source
function? I hope I didn’t miss something obvious and am asking for something that is not even necessary to achieve this goal.
In my rudimentary implementation of a Language Server integration plugin, I have resorted to always returning null from the source
function. And, then showed a tooltip once a response from the Language Server is received.
And in that same plugin, I was able to use linter
and autocompletion
without the same level of hacky code.