haskell / haskell/haskell-mode

Auto completions related notes

Open
#1,169 2 comments 0 reactions 1 assignee Claimed by @geraldus View on GitHub
Dominant language
Emacs Lisp
Stars
1.4k
Forks
354
Avg merge
5d 10h
Merged PRs (30d)
2

Description

There is some mess around completions. We have:
- `haskell-completions.el`
provides:
- hard-coded keywords list
- hard-coded pragma names list
- completion prefix grabbing functionality
- non-interactive completion function:
- pragmas, options, extensions, keywords
- synchronous completion function, which completes:
- pragmas, options, extensions, keywords **without** REPL
- identifiers **from** REPL if it is available
- modules for import statement **from** REPL if it is available
- `haskell-complete-module.el`
provides:
- `haskell-complete-module-read` — very complicated function, interactively completes module name using mini-buffer
- `haskell-modules.el`
depends on `haskell-complete-module.el`
provides:
- `haskell-add-import` — this is major use function, others seem to be for internal use; all functions depend on REPL, if it's not available `haskell-add-import` reads module name from mini-buffer

`haskell-complete-module-read` is used in[[1](https://github.com/haskell/haskell-mode/search?utf8=%E2%9C%93&q=haskell-complete-module-read)]:
- `haskell-mode-contextual-space` from `haskell.el` _(I didn't understand what does this function do yet)_
- `haskell-process-suggest-imports` from `haskell-load.el`
- `haskell-add-import` from `haskell-modules.el`

---
- [x] research if `haskell-completions-sync-completions-at-point` should cover a case when REPL is not available, e.g. provide dabbrev completions (at least Emacs and company)[[2](https://github.com/haskell/haskell-mode/blob/master/haskell-completions.el#L247-L250)]
- [ ] research possibility of merging `haskell-modules.el` and `haskell-complete-module.el`
- [ ] research possibility of merging two above packages with `haskell-completions.el`
- [ ] research if we really need all this stuff to import modules

Related to #215

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.