I don't think it's proper to move big part of functionality from one class to another only for the purpose of editing a tooltip.
Is there a good reason to have this functionality moved to ScriptEditorBase? In general this is a question of the purposes and roles of these classes.
ScriptEditorBase was meant to be a parent class for editor pane, which may have multiple different controls on it, besides script control. I suppose that it's better to have script parsing and related behavior (such as styling and tooltips) as close to the script text control itself as possible, which is ScintillaWrapper atm.
Events are a common solution for customizing behavior.
If it's necessary to inject some extra text to tooltip, you could add a event to ScintillaWrapper, subscribe in ScriptEditorBase, and provide reaction there.
Such event could pass a keyword and its information (what is it) in its arguments.
The async operation is a problem. But maybe it could display standard tooltip first, trigger the variable request, and then modify (replace) tooltip with an extended text as soon as an answer was received. OTOH, since the tooltip is displayed with a delay anyway, maybe the event could be triggered when the tooltip "timer" starts, and then the variable request will be processed in parallel with this delay.
Not looking into the code yet, only imagining, this could work like this:
1. ScintillaWrapper realizes it needs to display a tooltip, and fires event.
2. ScriptEditorBase receives event, checks if the editor is running a game test, and queries variable.
3. As soon as ScriptEditorBase gets an answer, it tells ScintillaWrapper to display extra text in tooltip. OR displays its own tooltip, besides / below the scintilla's one (idk if easy to do).
In this scenario, you should also detect when calltip was cancelled by moving cursor elsewhere.
Is there a good reason to have this functionality moved to ScriptEditorBase? In general this is a question of the purposes and roles of these classes.
ScriptEditorBase was meant to be a parent class for editor pane, which may have multiple different controls on it, besides script control. I suppose that it's better to have script parsing and related behavior (such as styling and tooltips) as close to the script text control itself as possible, which is ScintillaWrapper atm.
Events are a common solution for customizing behavior.
If it's necessary to inject some extra text to tooltip, you could add a event to ScintillaWrapper, subscribe in ScriptEditorBase, and provide reaction there.
Such event could pass a keyword and its information (what is it) in its arguments.
The async operation is a problem. But maybe it could display standard tooltip first, trigger the variable request, and then modify (replace) tooltip with an extended text as soon as an answer was received. OTOH, since the tooltip is displayed with a delay anyway, maybe the event could be triggered when the tooltip "timer" starts, and then the variable request will be processed in parallel with this delay.
Not looking into the code yet, only imagining, this could work like this:
1. ScintillaWrapper realizes it needs to display a tooltip, and fires event.
2. ScriptEditorBase receives event, checks if the editor is running a game test, and queries variable.
3. As soon as ScriptEditorBase gets an answer, it tells ScintillaWrapper to display extra text in tooltip. OR displays its own tooltip, besides / below the scintilla's one (idk if easy to do).
In this scenario, you should also detect when calltip was cancelled by moving cursor elsewhere.
