-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: Provide a cause for the onDidChangeTextDocument #36939
Comments
Sorry, not possible with breaking the API. The event is specified as just the editor, no place for extra information. |
Sorry, I'm a bit confused what you mean by breaking the API. What do you mean by "the event is specified as just the editor"? It already contains both the document and the contentChanges, no? There also seems to an already be an identifier property on For example, the important thing for me is that Basically, my use case is that when I copy text over from Neovim, I have to replace the entire buffer. Usually, when there's a TextDocumentChangeEvent from VSCode, I sync that over to Neovim, but in this case, it can cause a race. As in, the typical passing of data is (Neovim -> VSCode), then due to the TextDocumentChangeEvent, we have to do (VSCode -> Neovim). We have no way of knowing that the TextDocumentChangeEvent we're capturing is due to us, so we have to recopy. Now, if Neovim sends data twice, we have a race between handling the first TextDocumentChangeEvent and passing the data from Neovim -> VSCode the second time. |
@Chillee I think your title is wrong -- I think you meant |
haha, I should read more than the title. A dupe of #10801 (closed) because we actually don't know what's caused the change |
@jrieken I don't actually need to know it in the general case, I just need to know it for text edits that my extension is causing. It's a similar case for the remote editing plugin that the issue linked has. For this more limited case, is it not possible using an approach similar to what I mentioned in the comment? I could try hacking something if it's something that might be feasibly merged. |
It would be very helpful for to provide a
kind
/cause attribute for the TextDocumentChangeEvent, similar to the one provided forTextEditorSelectionChangeEvent
.@rebornix
The text was updated successfully, but these errors were encountered: