jaredly / jaredly/reason-language-server

Error "Command line is too long" in all reason and ocaml files on windows

Open
#262 7 comments 1 reaction 0 assignees View on GitHub
bug help wanted windows
Dominant language
OCaml
Stars
649
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Hi. I am working on a medium-sized React/Typescript project with bucklescript/reason/genType added manually. For a while everything worked fine, but at some point I started getting "command line is too long" errors in every Reason and OCaml file.
```
Running diagnostics for file:///c%3A/path_to_project/src/Api/reason/Api.mli
➡️ running bsc C:\path_to_project\node_modules\bs-platform\lib\bsc.exe -c -I "C:\path_to_project\lib\bs" -I "C:\path_to_project\lib\bs\src/ac-common" -I "C:\path_to_project\lib\bs\src/ac-common\AcButton" -I "C:\path_to_project\lib\bs\src/ac-common\AcButton\components" -I "C:\path_to_project\lib\bs\src/ac-common\AcClickOutsideListener" -I ...this goes on for around 9000 characters... "C:\path_to_project\node_modules\bs-platform\lib\ocaml" -bin-annot -bs-no-builtin-ppx-ml -bs-package-name react-js-app -open ReactJsApp -ppx "C:\path_to_project\node_modules\bs-platform\lib\reactjs_jsx_ppx_2.exe" -ppx C:\path_to_project\node_modules\bs-platform\lib\bsppx.exe -nostdlib -color always -w -30-40+6+7+27+32..39+44+45+101 -intf C:\path_to_project\node_modules\.lsp\Api-ReactJsApp.asti with pwd C:\path_to_project
<< Making lastDefinitions with type error for file:///c%3A/path_to_project/src/ac-common/Api/reason/Api.mli
type error here The command line is too long.
```

It seems like paths to all subfolders in the src folder (configured in bsconfig) are listed in one command, that is almost 10K characters long. As a result, this error masks any other errors or the possibility to have intellisense in any ReasonML/OCaml code.

I initially suspected it was the same issue as https://github.com/jaredly/reason-language-server/issues/232, but reverting to 1.4.1 didn't solve the problem.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Windows diagnostic failure in the Reason/OCaml files and inspect how bsconfig paths become arguments to the bsc command. Verify that diagnostics no longer exceed the Windows command-line limit and that type errors and IntelliSense are available again.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml, react, typescript
Domain
developer-experience, devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.