Skip to content
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

# Fix dropping of partialAccepts #199663

Merged
merged 4 commits into from
Dec 1, 2023

Conversation

marrej
Copy link
Contributor

@marrej marrej commented Nov 30, 2023

PartialAcceptances auto clear completions

repro in monaco env

TLDR: Issue with partially accepting characters that are already provided in the editor

Reproduction steps:

  1. place cursor in given position -> def foo(ba)
  2. type r
  3. try to partially accept completion (2x to get out of the def brackets)

Expected result:
the completion is persisted on screen as it was partially accepted and the prefix doesn't diverge

Actual result:
The completion is dropped.

Reasoning:
From my investigation this happens due to the explicit signal of cursor position change with type api. This is not the case while the user partially accepts completions, with only ghosted text (not yet in the editor).

Suggestion:

  • provide more comprehensive reason for position change, which should signal this is partialAcceptance/Acceptance and is a user trigger, not neccesarily an api OR update the onCursorChange to not trigger model.stop() when partialAccept is in progress (The earlier proposal might help in understanding what actually changes the position and there do not seem to be existing source === 'api' bindings, so no part of the system should be impacted)
  • To keep the interaction consistent we might want to also change the setPosition on Accept, as there is already explicit cleanup happening after the edits are executed.

@jrieken jrieken assigned hediet and unassigned jrieken Nov 30, 2023
@hediet hediet added this to the December 2023 milestone Nov 30, 2023
@hediet hediet merged commit 3fb8fd7 into microsoft:main Dec 1, 2023
6 checks passed
@marrej marrej deleted the fix-partial-accept-dropping branch December 1, 2023 20:23
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants