AsyncResultResolver class

Takes an add-in’s answer to a request of the IDE’s, which the IDE waits for. The event that makes the request passes one, and the add-in calls its Resolve once, before the handler returns or later.

Where it comes from What it answers
HtmlEventProperties.AsyncResultResolver a request of a datasheet
SourceHoverProvider.Hover the text to add to a hover
SourceCodeLensProvider.GetResults the lenses of a file
AIConversation.ToolCall the result of one of the add-in’s tools

The handler may keep the resolver and call it from a timer or another thread. The datasheet of Sample 27 is answered that way, from worker threads that read a database.

Methods

Resolve

Gives the answer.

Syntax: resolver.Resolve retval [, MimeType ]

retval
required The answer. Variant; each request takes a String, whose form its page gives.
MimeType
optional The type of retval, for a tool’s result that is not text: "image/png", "image/jpeg", "image/webp" or "image/gif", with retval the image as base64. String. Only AIConversation.ToolCall takes it; see there.

SetPriority

Places a hover provider’s answer among the others in the hover. Call it before Resolve. Answers show in the order of their priority, the lowest first, after the IDE’s own text; an answer whose provider calls no SetPriority has priority 0. Only a hover uses it.

Syntax: resolver.SetPriority Priority

Priority
required The priority. Long.

See Also