You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could be a promise conversion timing issue. Not sure who the right owner is here but I did some initial investigation. Here's what I believe is going wrong:
Starting in ModelServiceImpl.createModel
This method calls setMode which invokes .then on the mode promise. This block is not evaluated yet.
We next continue on with createModel which calls into MainThreadDocumentsAndEditors. This code sends the document delta to the extesion host with the incorrect plaintext document mode.
At some later point, the .then block from setMode is then evaluated and we update the document to have the correct markdown mode
I suspect the .then in setMode used to by resolved synchronously
Definitely caused by the asynchronous then, thank you for the analysis @mjbvz. Since I converted the IModeService to use native promises, I will look into addressing the issue.
Steps to Reproduce:
Bug
Markdown preview does not update to show the preview of the new document.
The root cause is that
onDidChangeActiveTextEditor
is fired with aeditor.document.languageId
that is set toplaintext
instead ofmarkdown
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: