google / google/codeworld

Add completion possibilities that split the current token

Open
#1,199 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

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.