Skip to content

WIP: Move core typedefs out of Js modules - #7129

Closed
cknitt wants to merge 1 commit into
rescript-lang:masterfrom
cknitt:core-typedefs
Closed

cknitt wants to merge 1 commit into
rescript-lang:masterfrom
cknitt:core-typedefs

Conversation

@cknitt

@cknitt cknitt commented Oct 25, 2024

Copy link
Copy Markdown
Member

No description provided.

@cknitt
cknitt force-pushed the core-typedefs branch 4 times, most recently from 830ec22 to 5828460 Compare October 25, 2024 14:50
@cknitt cknitt changed the title WIP: Move typedefs from Js modules to core modules WIP: Move core typedefs out of Js modules Oct 25, 2024
@cknitt

cknitt commented Oct 26, 2024

Copy link
Copy Markdown
Member Author

The approach in this PR works fine for me. As mentioned, I had issues when putting the typedefs directly into the individual Core modules, see #7126 (comment).

Done so far for date and regExp, shall I continue this way for the other types @cristianoc @zth ?

@cristianoc

Copy link
Copy Markdown
Collaborator

The approach in this PR works fine for me. As mentioned, I had issues when putting the typedefs directly into the individual Core modules, see #7126 (comment).

Done so far for date and regExp, shall I continue this way for the other types @cristianoc @zth ?

The questions is what we want to expose to the user when hovering. @zth ?

@cknitt

cknitt commented Oct 26, 2024

Copy link
Copy Markdown
Member Author

The questions is what we want to expose to the user when hovering. @zth ?

@cristianoc @zth Hover would currently look like this:

Bildschirmfoto 2024-10-26 um 13 00 48

Bildschirmfoto 2024-10-26 um 13 01 25

@zth

zth commented Oct 27, 2024 •

Copy link
Copy Markdown
Member

Probably something we'll have to make look artificially better in the editor tooling anyway. So I'm fine with this.

Ideally from my POV, the first hover should just be date and not include type Pervasives.date = CoreTypes.date. And the second one just be Type Date.t = date. So, in other words, always hide CoreTypes and Pervasives. Half baked though maybe, but that's what I think at a glance.

@cristianoc

Copy link
Copy Markdown
Collaborator

We can separately think about what is the ideal way of expressing a type.
And the editor should nudge towards that way.

Btw gentype currently has the issue that work worse for code included in the compiler than for user code. (When looking for where a type is defined, as well as shipping .tsx files).
This will be addressed when it is revamped. And for now it's necessary to hard code all the possible paths as in this PR.

Let's go with this.

@cknitt
cknitt marked this pull request as ready for review October 27, 2024 11:21
@cknitt
cknitt marked this pull request as draft October 27, 2024 11:21
@cknitt

cknitt commented Feb 9, 2025

Copy link
Copy Markdown
Member Author

Superseded by #7285.

@cknitt cknitt closed this Feb 9, 2025
@github-actions
github-actions Bot deleted the core-typedefs branch September 11, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants