This is making me really wonder about the lifecycle of this component: hitting a pretty bad bug in which rejectSuggestionCommand is called with a document of the wrong length, which causes a hard crash. It's hard to replicate in isolation.
function viewCompletionPlugin() {
return EditorView.updateListener.of((update) => {
if (update.focusChanged) {
rejectSuggestionCommand(update.view);
}
});
}
This always goes through the focusChanged path. At the very least it should be possible to make sure that the length of the Changeset is the same as the document.
RangeError: Applying change set to a document with the wrong length
at ChangeSet.apply(../../../node_modules/@codemirror/state/dist/index.js:882:19)
at get Transaction.newDoc(../../../node_modules/@codemirror/state/dist/index.js:2292:55)
This is making me really wonder about the lifecycle of this component: hitting a pretty bad bug in which
rejectSuggestionCommand
is called with a document of the wrong length, which causes a hard crash. It's hard to replicate in isolation.This always goes through the focusChanged path. At the very least it should be possible to make sure that the length of the Changeset is the same as the document.