Skip to content

feat: position encoding negotiation (#10)#16

Merged
meymchen merged 1 commit into
mainfrom
feat/position-encoding-negotiation
Jun 16, 2026
Merged

feat: position encoding negotiation (#10)#16
meymchen merged 1 commit into
mainfrom
feat/position-encoding-negotiation

Conversation

@meymchen

Copy link
Copy Markdown
Owner

Closes #10.

Builds on the Documents store introduced in #12 to negotiate the LSP position encoding during initialize.

  • Changes server_capabilities(&self) to server_capabilities(&self, &InitializeParams) so it can read the client's offered encodings.
  • Intersects general.positionEncodings with lspf's preference order [utf-8, utf-16], falling back to UTF-16.
  • Writes the chosen kind into the Documents store so existing conversion methods pick it up automatically.
  • Adds integration tests for the default, UTF-8, UTF-16-only, unsupported, and preference-order cases.

All tests pass and clippy is clean.

- Change server_capabilities(&self) to server_capabilities(&self, &InitializeParams)
- Negotiate UTF-8 preferred / UTF-16 fallback from client general.positionEncodings
- Write the chosen encoding into the Documents store
- Add integration tests covering default, UTF-8, UTF-16-only, unsupported,
  and preference-order behavior
@meymchen meymchen merged commit ddad8c7 into main Jun 16, 2026
3 checks passed
@meymchen meymchen deleted the feat/position-encoding-negotiation branch June 16, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Position encoding negotiation (UTF-8 preferred, UTF-16 fallback)

1 participant