Skip to content

Conversation

aviatesk
Copy link
Owner

@aviatesk aviatesk commented Aug 9, 2025

This commit introduces a major refactoring of position encoding handling throughout the JETLS codebase to properly support LSP's position encoding negotiation (UTF-8, UTF-16, and UTF-32).

Key architectural changes:

  • Add encoding::PositionEncodingKind.Ty field to ServerState to track the resolved position encoding negotiated with the client
  • Also add encoding field to FileInfo struct to avoid having to pass server::Server object to several subroutines
  • Create new utils/string.jl module with comprehensive encoding conversion functions

Also includes a bunch of test refactoring.

before after
Screenshot 2025-08-09 at 09 00 28 Screenshot 2025-08-09 at 09 02 19

@aviatesk aviatesk changed the title encoding: refactor position encoding management and add proper UTF-8/16/32 support refactor position encoding management and add proper UTF-8/16/32 support Aug 9, 2025
@aviatesk aviatesk changed the title refactor position encoding management and add proper UTF-8/16/32 support add proper UTF-8/16/32 encoding support Aug 9, 2025
Copy link

codecov bot commented Aug 10, 2025

Codecov Report

❌ Patch coverage is 92.54658% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.59%. Comparing base (4ea5b63) to head (eb0bd11).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/utils/string.jl 94.05% 6 Missing ⚠️
src/lifecycle.jl 72.72% 3 Missing ⚠️
src/diagnostics.jl 88.23% 2 Missing ⚠️
src/formatting.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   68.21%   68.59%   +0.38%     
==========================================
  Files          35       36       +1     
  Lines        3001     3066      +65     
==========================================
+ Hits         2047     2103      +56     
- Misses        954      963       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This commit introduces a major refactoring of position encoding handling
throughout the JETLS codebase to properly support LSP's position
encoding negotiation (`UTF-8`, `UTF-16`, and `UTF-32`).

Key architectural changes:
- Add `encoding::PositionEncodingKind.Ty` field to `ServerState` to
  track the resolved position encoding negotiated with the client
- Also add `encoding` field to `FileInfo` struct to avoid having to pass
  `server::Server` object to several subroutines
- Create new utils/string.jl module with comprehensive encoding
  conversion functions

Also includes a bunch of test refactoring.
@aviatesk aviatesk merged commit 854b349 into master Aug 10, 2025
8 checks passed
@aviatesk aviatesk deleted the avi/encoding branch August 10, 2025 08:08
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.

1 participant