I recently started to write a Sublime 3 plugin that acts as custom build system for a little programming language that we develop in-house. The plugin executes the compiler of our language (by extending Default.exec.ExecCommand, should that be relevant), parses the errors reported by the compiler and marks the erroneous fragments of the code in the current editor view with squiggly lines and by putting small symbols into the gutter (by using sublime.Region, as one would expect).
Is it possible to make those error regions somehow interactive such that a small overlay box/window is created (next to the mouse cursor) that displays the compiler error message that gave corresponds to the error region? I essentially have the kind of overlays in mind that IDEs such as Eclipse or IntelliJ use to show error messages, API docs, variable types, etc.
According to question https://forum.sublimetext.com/t/semi-transparent-overlay-window/8173/2&hilit=overlay#p45691, overlays were not possible in 2013. Did that change? What about interactive regions?
I would also be fine with a partial solution, for example
- If only interactive regions are possible, then I would consider displaying the error message in the status bar.
- If only overlays are possible, then I would consider using a keyboard short-cut to display the original error in the overlay by mapping the current cursor position to the containing error region and then to the correct error message.
EDIT 1: Extending EventListener and using on_selection_modified I was able to “fake” interactive regions by probing whether the cursor (view.sel()[0]) is contained in one of the error regions, and if, I show the corresponding compiler error in the status bar. Is that the best possible way of achieving what I want? I assume that an event bound to the regions would perform better.