monaco-languageclient
monaco-languageclient copied to clipboard
Quick fix is not available when changing message in middleware.
Quick fix is not available when changing message in middleware.
return new MonacoLanguageClient({
name: 'client name',
clientOptions: {
...
middleware: {
handleDiagnostics: (uri, d, next) => {
const newd = d.map((v) => {
if (v.message.includes("fix available")) {
+ v.message = "change message";
}
return v;
});
next(uri, newd);
}
}
}
});
or is it a monaco-editor issue?
@CherryPetale Does this work as expected in vscode? I don't think this should work, since the code actions/quick fixes are attached to the diagnostic. If the diagnostic changes somehow in transition, it is expected that the editor cannot attach the code actions anymore, since the diagnostic they were attached to no longer exists (at least in the expected form).
@msujew I don't know how to check with vscode so I can't try right away, but all I am trying to do is translate and display the error text, so if it is too difficult I will give up.
@CherryPetale did succeed with reproducing it in VSCode?
@kaisalmen Sorry. I didn't know how to do it and gave up. Also, I am going to close issue if there are no problems, as it does not seem to be the original use of the middleware in the first place.
@CherryPetale I will close this now. Feel free to open another issue or discussion if it makes sense.