Use the mapped result when remapping an ActiveResult through changes #31

Merged
marijn merged 1 commit from ondrejmirtes/autocomplete:active-result-map-fix into main 2026-06-03 16:47:41 +02:00
Contributor

ActiveResult.map(mapping) was calling result.map(...) to remap the result through doc changes that the active completion survives, but then constructing the new ActiveResult from this.result (the original). That meant additionalTextEdit positions and any other state a source rewrites in its map function were silently discarded along this code path.

`ActiveResult.map(mapping)` was calling `result.map(...)` to remap the result through doc changes that the active completion survives, but then constructing the `new ActiveResult` from `this.result` (the original). That meant additionalTextEdit positions and any other state a source rewrites in its map function were silently discarded along this code path.
ActiveResult.map(mapping) was calling result.map(...) to remap the result through doc changes that the active completion survives, but then constructing the new ActiveResult from this.result (the original). That meant additionalTextEdit positions and any other state a source rewrites in its map function were silently discarded along this code path.
marijn merged commit 88a9f4a9fa into main 2026-06-03 16:47:41 +02:00
Owner

Wow, funny how that has sat around for years. Thanks for finding this.

Wow, funny how that has sat around for years. Thanks for finding this.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/autocomplete!31
No description provided.