Add completion possibilities that split the current token
- Dominant language
- Haskell
- Stars
- 1.3k
- Forks
- 201
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following (where the vertical line represents the cursor position):
program = dr|codeWorldLogo
Triggering autocomplete will now try to match the entire token, `drcodeWorldLogo`. Autocomplete will decide that `drawingOf` is the best suggestion by far, and turn the whole thing into `drawingOf`. The `codeWorldLogo` is lost.
Instead, auto-complete should be willing to also consider splitting the token into `dr` (before the cursor) and `codeWorldLogo` at the end. If they are BOTH close to existing tokens, then autocomplete should potentially replace the `dr` with `drawingOf`, and leave `codeWorldLogo` alone. The decision about whether to split the current token or not should be made based on the edit distance to turn the portion after the cursor into a known token, as compared to the edit cost of deleting it after this completion, possibly with some weighting in favor of one or the other choice.
Contributor guide
Assessment
This issue has not been assessed yet.