rescript-vscode icon indicating copy to clipboard operation
rescript-vscode copied to clipboard

Pervasives is open in autocomplete with -nopervasives flag

Open bloodyowl opened this issue 3 years ago • 3 comments

I'm experimenting only opening a subset of Pervasives so that none of OCaml's style leak to the user.

https://github.com/bloodyowl/rescript-js/blob/main/src/ReScriptJs__Pervasives.res

Using the following bsc-flags, it seems like Pervasives isn't conditioned to the absence of -nopervasives flag.

[
  "-open Belt",
  "-open ReScriptJs__JsWithPervasives",
  "-nopervasives"
]

bloodyowl avatar May 31 '21 11:05 bloodyowl

++ @bobzhang : is -nopervasives part of the officially supported API?

cristianoc avatar May 31 '21 11:05 cristianoc

only opening a subset of Pervasives so that none of OCaml's style leak to the user.

That's something we want to achieve in the upstream too, do you have a list of functions to hide? nopervasives works but should be an internal flag. @bloodyowl I would suggest we work together in this direction, there is a similar discussion here

bobzhang avatar Jun 01 '21 02:06 bobzhang

Once something official is worked out, we can support it in the editor.

cristianoc avatar Jun 01 '21 04:06 cristianoc