Skip to content

Create haskell-overlay.el #1170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gracjan opened this issue Feb 21, 2016 · 1 comment
Closed

Create haskell-overlay.el #1170

gracjan opened this issue Feb 21, 2016 · 1 comment

Comments

@gracjan
Copy link
Contributor

gracjan commented Feb 21, 2016

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.

@gracjan
Copy link
Contributor Author

gracjan commented Aug 7, 2016

Or better not. This should be a separate package that haskell-mode depends on. flycheck is halfway there.

@gracjan gracjan closed this as completed Aug 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant