I have two plugin that use dispatch:
(1) (github copilot or GPT) autosuggestion plugin(GitHub - saminzadeh/codemirror-extension-inline-suggestion: A CodeMirror extension to display inline suggestions):
src/extension.ts:
update.view.dispatch({
effects: InlineSuggestionEffect.of({ text: result, doc: doc }),
});
(2)(LSP) @codemirror/lint plugin, how I use it( codemirror-languageserver/src/index.ts at master · FurqanSoftware/codemirror-languageserver (github.com)):
this.view.dispatch(setDiagnostics(this.view.state, diagnostics));
Conflict problem:
When lint is enabled, autosuggestion effects disappears(autosuggestiontext disappears).
It seem like the effect of InlineSuggestionEffect disappears.
This problem can also simply repeat by:
autosuggestion will disappears when update.view.dispatch(setDiagnostics(update.view.state, ));
So I guess there’s something wrong with my code: this.view.dispatch(setDiagnostics(this.view.state, diagnostics));