-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
[HTML] server contains invalid implementation of applyEdit #45014
Comments
@dbaeumer What do you mean by "the editor which usually applies these edits"? VSCode uses unstable sort (unless it overrides TypeScript's |
@idanarye VS Code offers API for extension to apply edits to an open buffer. When this API is called the editor itself sorts the array using a stable sort algorithm as defined in the LSP spec. See: https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.d.ts#L5556 |
The protocol has changed to define that multiple edits can have the same position, and should be applied using the order inside the array. The current implementation in VSCode, however, is using unstable sort - meaning the order they will be applied in will be arbitrary.
Specifically, with one equivalence class TypeScript's current implementation of
sort
will reverse the array - which is exactly the opposite of what the specs specify.To be compliant with the specs, VSCode must use stable sort on the edits.
The text was updated successfully, but these errors were encountered: