llm-ls/crates
Jeremy Elalouf 078d4c7af2
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.
2024-03-07 13:50:52 +01:00
..
custom-types fix: deserialize url null value w/ default if backend: huggingface (#75) 2024-02-12 20:07:59 +01:00
llm-ls Feature/multiple encodings handled (#88) 2024-03-07 13:50:52 +01:00
lsp-client test: fix invalid deserialization (#85) 2024-02-19 17:25:42 +01:00
mock_server feat: improve tokenizer config (#21) 2023-09-21 17:57:19 +02:00
testbed test: fix invalid deserialization (#85) 2024-02-19 17:25:42 +01:00