Accept initialize requests with out-of-range process IDs
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
The issue is in the workspace actor's decoding of InitializeParams. Look at the code that handles the initialize request, likely in a file related to the workspace actor or LSP initialization. The test a_process_id_that_cannot_be_represented_installs_no_monitor is a starting point but needs to be updated or a new workspace-level test added. Ensure the decode succeeds for out-of-range processId by either ignoring the field or handling it gracefully, while parent::process_id remains unchanged. Verify by running the new test and any existing LSP tests.
Written by the indexing model from the issue text.
Description
Context
Since #549, the workspace actor decodes initialize parameters as gen-lsp-types' InitializeParams, which types processId as Option<i32>. lsp-types 0.95 typed it as Option<u32>.
An editor that sends a processId above 2³¹−1 now has initialize rejected with InvalidParams (invalid value: integer '2147483648', expected i32), so the language server cannot start. The workspace does not use processId at all.
The protocol actor already handles this case on its own: parent::process_id reads processId from the raw JSON and declines to monitor an ID that does not fit in i32. The server test a_process_id_that_cannot_be_represented_installs_no_monitor expresses that intent, but it still passes because it uses a fake workspace and never exercises the real decoding.
LSP defines integer as a signed 32-bit value, so such IDs are outside the specification, and they are rare in practice. The server should still not refuse to start over a field the workspace ignores.
Goal
An out-of-range processId must not prevent initialize from succeeding. Parent process monitoring keeps its current behavior of skipping IDs it cannot represent.
Scope
- Decode only the
initializefields the workspace uses (capabilities and workspace folders), or otherwise stop an unrepresentableprocessIdfrom failing the decode. - Keep
parent::process_idas the single owner ofprocessIdinterpretation.
Tests
- A workspace-level test that sends
initializewithprocessId: 2147483648and receives anInitializeResult. - Consider covering the same case end to end, since the existing server test cannot observe workspace decoding.
- Dominant language
- Rust
- Stars
- 102
- Forks
- 11
- Avg merge
- 3h 31m
- Merged PRs (30d)
- 134
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from purefunctor/purescript-iris
-
bug language-server
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
purefunctor/purescript-iris#552 ·
-
enhancement language-server lsp-3.18
Difficulty 3/5 1-2 days Newbie friendliness 65/100
purefunctor/purescript-iris#548 ·
-
tooling
Difficulty 4/5 3-5 days Newbie friendliness 58/100
purefunctor/purescript-iris#507 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
purefunctor/purescript-iris#264 ·
-
checking semantics
purefunctor/purescript-iris#147 · 1 assignee ·
All issues in purefunctor/purescript-iris
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
TheLarkInn/aipm#2413 ·
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
todo:ticket
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
taikoxyz/taiko-mono#22168 · 1 comment ·