google / google/codeworld

Add completion possibilities that split the current token

Offen
#1,199 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Haskell
Sterne
1.3k
Forks
201
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Im Issue werden keine Implementierungsdateien oder Tests genannt. Beginne damit, den Autocomplete-Code zu finden, der zum aktuellen Token und seiner Edit-Distance-Logik passt, und verfolge anschließend, wie der Cursor das Token aufteilt. Fertig ist die Arbeit, wenn Autocomplete den Ersatz des gesamten Tokens mit der Aufteilung vor dem Cursor vergleichen, ein gültiges Suffix beibehalten und konsistent zwischen den Alternativen wählen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
haskell
Bereich
developer-experience
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.