-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gentype: propagate more comments #6334
Conversation
export const DecideSubject__placeholder: (run:string, times:number) => void = CommentsBS.DecideSubject._placeholder; | ||
|
||
export const DecideSubject: { _placeholder: (run:string, times:number) => void } = CommentsBS.DecideSubject | ||
export const DecideSubject: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This const
represents the DecideSubject
module in Comments.res
, and it has a comment in the original res file, but I cannot for the life of me figure out how to propagate that comment out to here. It would be very valuable though, comments for modules are important.
@cristianoc any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gentype does not store info about modules.
It stores info about values, and what module they belong to.
I guess this would go to some separate module info somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After trying several different approaches with no luck I conclude this seem to require some fairly deep changes. Maybe I'm missing something valuable.
The rest in this PR is useful by itself - maybe we could review and merge what's in this PR, and then do module comments separately.
66bba3f
to
f546358
Compare
f546358
to
cc6210e
Compare
jscomp/gentype/GenTypeCommon.ml
Outdated
@@ -2,6 +2,23 @@ module StringMap = Map.Make (String) | |||
module StringSet = Set.Make (String) | |||
module Config = GenTypeConfig | |||
|
|||
module DocString : sig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
jscomp/gentype/GenTypeCommon.ml
Outdated
@@ -2,6 +2,23 @@ module StringMap = Map.Make (String) | |||
module StringSet = Set.Make (String) | |||
module Config = GenTypeConfig | |||
|
|||
module DocString : sig | |||
type t | |||
val make : string option -> t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this abstraction?
An explicit string option would remove make and the interface.
Unless this will change in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably do without it. It was mostly a way to make sense of all the places where we had docstrings, where they would occasionally be formatted as comments already, and occasionally not. But I can probably just make it a string option now again. Let me give it a shot.
This propagates more comments from the ReScript code to emitted TS code via gentype.