Skip to content

Create haskell-overlay.el #1170

Closed
Closed
@gracjan

Description

@gracjan

Haskell Mode needs an overlay management code that will provide the following:

  1. Way to create overlays.
  2. Way to remove overlays that are no longer valid (invalidate).
  3. Way to associate actions with overlays.
  4. Way to associate documentation strings with overlays.
  5. Way to navigate to next/prev overlay.
  6. 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:

  1. C-c C-c - activate default fixup action. Key bound both in source buffer and in GHCi buffer.
  2. C-u C-c C-c - activate secondary fixup action.
  3. C-u 3 C-c C-c - activate tertiary fixup action. And so on..
  4. 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.
  5. 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.
  6. RET, switch to where the error is, active only in GHCi buffer.
  7. 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.

Reference: #1109, #856 and #770.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions