You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Haskell Mode needs an overlay management code that will provide the following:
Way to create overlays.
Way to remove overlays that are no longer valid (invalidate).
Way to associate actions with overlays.
Way to associate documentation strings with overlays.
Way to navigate to next/prev overlay.
Way to navigate to related overlay.
There is already some code about overlays in haskell-load.el can should be refactored.
Workings:
When a Haskell source code is loaded GHC produces warning and error messages. Those messages should be parsed and based on the information there two overlays should be created: one over offending part of code and the other one over the message in GHCi buffer. The source code overlay should have the whole GHC message as a tooltip. The GHCi overlay should react to RET and navigate to the source code. Both overlays should have zero, one or more fixup actions associated. Both actions should have clear information in the tooltip what will happen in each fixup actions and how to activate those. A fixup action is an elisp function that knows what to change in code so that the message goes away. Fixup actions should remove the overlay in the source code and all other overlays that were fixed. Overlays should be marked on the fringe so that there is visual indication there is something there.
Keybindings:
C-c C-c - activate default fixup action. Key bound both in source buffer and in GHCi buffer.
C-u C-c C-c - activate secondary fixup action.
C-u 3 C-c C-c - activate tertiary fixup action. And so on..
Need a better keybinding: M-n - go to next overlay in the same source file or in GHCi buffer. If used in GHCi buffer it should center source code on the error.
Need a better keybinding: M-p - go to prev overlay in the same source file or in GHCi buffer. If used in GHCi buffer it should center source code on the error.
RET, switch to where the error is, active only in GHCi buffer.
Need key: center other window to where the error is but do not switch there, key bound only in GHCi buffer.
Default fixup action should NOT ask any questions, if there is something to ask default action should use sensible defaults, secondary action can ask questions.
Caveats:
if the functionality should be done using overlays or text properties is an open question.
Haskell Mode needs an overlay management code that will provide the following:
There is already some code about overlays in
haskell-load.el
can should be refactored.Workings:
When a Haskell source code is loaded GHC produces warning and error messages. Those messages should be parsed and based on the information there two overlays should be created: one over offending part of code and the other one over the message in GHCi buffer. The source code overlay should have the whole GHC message as a tooltip. The GHCi overlay should react to RET and navigate to the source code. Both overlays should have zero, one or more fixup actions associated. Both actions should have clear information in the tooltip what will happen in each fixup actions and how to activate those. A fixup action is an elisp function that knows what to change in code so that the message goes away. Fixup actions should remove the overlay in the source code and all other overlays that were fixed. Overlays should be marked on the fringe so that there is visual indication there is something there.
Keybindings:
Default fixup action should NOT ask any questions, if there is something to ask default action should use sensible defaults, secondary action can ask questions.
Caveats:
Reference: #1109, #856 and #770.
The text was updated successfully, but these errors were encountered: