You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after rescript legacy build the sourcedirs file was generated. but i can't get it to do more than above. i also tried putting the reanalyze section in rescript.json. no difference
i actually think i got it working now by doing npx rescript legacy build and then npx rescript-tools reanalyze -all which seems to generate expected output more or less. it doesn't work without npx rescript legacy build though (because rewatch isn't generating .sourcedirs.json)
also i'm getting tons of "argument unsused" for optional arguments in functions where i actually DO use the argument, is this expected?
toMins might raise Division_by_zero (Duration.res:22:42) and is not annotated with @raises(Division_by_zero)
for:
let toMillis = (d: t): float => d
let toMins = (d: t): float => d->toMillis / 60_000.0
is there a manual on how to work with reanalyze? i'm sure it'll be helpful i just need to understand what's going on (also sorry for turning this into some general question thread)
Okay, I'm able to confirm that our new build system does not support reanalyze.
I had to use rescript legacy build to get reanalyze working. Will create an issue for that shortly.
thanks, but npx rescript build --create-sourcedirs creates an empty .sourcedirs.json: {"dirs":[],"generated":[],"pkgs":[]}
while npx rescript legacy build actually populates it
Yes, I noticed that as well. We are working on a fix for that.
Thanks for your patience 🙏
no problems, appreciating your feedback. is there an appropriate place to file issues for reanalyze? i think i'm finding a few bugs
Activity
fhammerschmidt commentedon Jul 18, 2025
It's part of rescript-tools
tx46 commentedon Jul 18, 2025
how do i get it to actually do something? i'm running it from the same dir that rescript.json/package.json is in
fhammerschmidt commentedon Jul 18, 2025
you need to build your project first in order to generate a
lib/bs/.sourcedirs.jsontx46 commentedon Jul 18, 2025
i'm building, but it's not generated. using rescript 12 beta1
nojaf commentedon Jul 18, 2025
And you might need some stuff in your rescript.json? Can't remember, will take a look at my setup once back at my desk.
fhammerschmidt commentedon Jul 18, 2025
Forgot to add that:
https://rescript-lang.org/docs/manual/v12.0.0/editor-code-analysis#configuration
tx46 commentedon Jul 18, 2025
after
rescript legacy buildthe sourcedirs file was generated. but i can't get it to do more than above. i also tried putting thereanalyzesection in rescript.json. no differencetx46 commentedon Jul 18, 2025
is rescript v12 not supported or something? it literally doesn't do anything except output the above
fhammerschmidt commentedon Jul 18, 2025
right, the current published tools version is 9 months old
at the very least we need to publish a new tools version first
or is anything else missing @zth ?
nojaf commentedon Jul 18, 2025
Rescript-tools is part of the rescript npm package since v12. If you installed it separately that will be an incompatible version.
tx46 commentedon Jul 19, 2025
all of this is kind of confusing. how do i actually run reanalyze for rescript v12?
tx46 commentedon Jul 19, 2025
i actually think i got it working now by doing npx rescript legacy build and then npx rescript-tools reanalyze -all which seems to generate expected output more or less. it doesn't work without npx rescript legacy build though (because rewatch isn't generating .sourcedirs.json)
also i'm getting tons of "argument unsused" for optional arguments in functions where i actually DO use the argument, is this expected?
tx46 commentedon Jul 19, 2025
also this:
for:
is there a manual on how to work with reanalyze? i'm sure it'll be helpful i just need to understand what's going on (also sorry for turning this into some general question thread)
nojaf commentedon Jul 19, 2025
Okay, I'm able to confirm that our new build system does not support reanalyze.
I had to use
rescript legacy buildto get reanalyze working. Will create an issue for that shortly.As for config I have:
And I invoke it via
npx rescript-tools reanalyze -json.Since v12, you do not need to install https://www.npmjs.com/package/@rescript/tools
The binary is bundled as part of https://www.npmjs.com/package/rescript
nojaf commentedon Jul 19, 2025
Okay, turns out you need to pass
--create-sourcedirsto yournpx rescript buildfor rewatch to generate thelib/bs/.sourcedirs.jsonfile in v12.tx46 commentedon Jul 19, 2025
thanks, but
npx rescript build --create-sourcedirscreates an empty .sourcedirs.json:{"dirs":[],"generated":[],"pkgs":[]}while
npx rescript legacy buildactually populates ittx46 commentedon Jul 19, 2025
is there a way to turn off exception analysis warnings for
paniccalls? they don't make sense to mealso: why am i getting division_by_zero warnings for things such as
x / 10? is this a bug in reanalyze?nojaf commentedon Jul 19, 2025
Yes, I noticed that as well. We are working on a fix for that.
Thanks for your patience 🙏
tx46 commentedon Jul 19, 2025
no problems, appreciating your feedback. is there an appropriate place to file issues for reanalyze? i think i'm finding a few bugs
nojaf commentedon Jul 19, 2025
Yeah the main rescript repository would be the right place for that. Much appreciated!