Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/multiple encodings handled (#88)
* feat: support added for multiple encodings Actually, the only supported encoding was UTF-8. In cases where the editor sends updates encoded in UTF-16, the mirror of the user's workspace goes out of sync, leading to a server crash. Furthermore, UTF-16 is the default and mandatory encoding for the protocol, and servers must support it. Therefore, it is imperative to ensure its support. Now, to avoid any unnecessary conversion, the server negotiates the encoding with the client during the initialization phase. This allows the server to choose its preferred encoding in cases where it is available. See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments * style: format added code using rustfmt * feat: cargo clippy warnings fixed * test: add some unit tests for the new `apply_content_change` function * feat: review comments fixed Use of the `document::PositionEncodingKind` enum everywhere it's possible and TryFrom implemented on it. Also, LspError are not used anymore. * feat: review comments fixed, mostly style.
- Loading branch information