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
I encountered the following sequence of events when using the language client in vscode:
documentChange
codeAction - with a caret position which was valid before documentChange but became invalid after documentChange
cancelRequest for the previous code action
It looks to me that sending codeAction, after we sent documentChange event shouldn't happen. Is it a bug or is it a normal behavior? If it's normal behavior, it would be nice if we have a document version in the code action request.
async.map could yield the main process to other activities, and as a result code action might be invoked after the text change was called.
I don't know how to make a fix for it. I created a workaround in our language server, but it would be nice if a long term fix is created in the library.
Activity
[-]Incorrect order of events[/-][+]Suspicious order of events[/+]tooltitude-support commentedon Apr 11, 2023
I investigated code.
Main process: text document changes, are broadcast before the code action event
Ext. host. When changes are received they are immediately broadcast/called.
Language client. Here it's interesting.
async.map could yield the main process to other activities, and as a result code action might be invoked after the text change was called.
I don't know how to make a fix for it. I created a workaround in our language server, but it would be nice if a long term fix is created in the library.
dbaeumer commentedon Apr 12, 2023
Tooltitude Support (@tooltitude-support) very good find and analysis. Need to think about how to best fix this.
dbaeumer commentedon Apr 12, 2023
Discussed with the VS Code team and the best approach right now is to make the params conversion sync.
Fixes #1228: Suspicious order of events
Fixes #1228: Suspicious order of events (#1230)
tooltitude-support commentedon Apr 12, 2023
Dirk Bäumer (@dbaeumer) Thanks for fixing this so quickly!