zed-ets-language-server 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -48,7 +48,12 @@ async function main() {
48
48
  });
49
49
 
50
50
  // Set up forwarding of process.stdin to serverProcess IPC
51
- process.stdin.setEncoding('utf8');
51
+ // Note: We intentionally do NOT call setEncoding('utf8') here because:
52
+ // 1. LSP Content-Length is measured in bytes, not characters
53
+ // 2. TCP data can be split at arbitrary byte boundaries, including mid-multibyte UTF-8
54
+ // 3. If setEncoding('utf8') is used and data splits mid-character, the decoder may
55
+ // produce replacement characters or corrupt the byte boundary tracking
56
+ // By keeping stdin as raw Buffer, data-parser.js can correctly track byte positions
52
57
  process.stdin.on('data', (data) => parse(data, async (message) => {
53
58
  // This special ets request is required in document: https://github.com/ohosvscode/arkTS/tree/next/packages/language-server
54
59
  // When this goes wrong, ETS UI decorators and functions will be type of any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zed-ets-language-server",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "ETS language server wrapper for Zed ArkTS extension.",
5
5
  "type": "module",
6
6
  "main": "index.js",