Skip to content
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

Hide Stdlib module name from editor tooling output #7301

Closed
zth opened this issue Feb 17, 2025 · 3 comments
Closed

Hide Stdlib module name from editor tooling output #7301

zth opened this issue Feb 17, 2025 · 3 comments
Assignees

Comments

@zth
Copy link
Collaborator

zth commented Feb 17, 2025

With the latest changes to the stdlib (#7285) we've now got a few places where the Stdlib prefix "leaks" into the editor tooling. Leaks isn't really a correct way of putting it, since it's perfectly valid, but I'm thinking it'd be a good idea to figure out a way of hiding the Stdlib prefix.

A few examples of how it can look:

(array<'a>, Stdlib_Symbol.t) => 'b

('a, 'a) => Stdlib_Ordering.t

Stdlib_Iterator.t<'a> => array<'a>

"detail": "Stdlib.Date.t",

Stdlib.Promise.t<documentSnapshot<'documentdata>>

I'm thinking it'd be preferable if the above instead showed:

(array<'a>, Symbol.t) => 'b

('a, 'a) => Ordering.t

Iterator.t<'a> => array<'a>

"detail": "Date.t",

Promise.t<documentSnapshot<'documentdata>>

Not sure what the best approach here would be. @cristianoc you have any ideas?

@cristianoc
Copy link
Collaborator

Does it show up in compiler error messages too?

@zth
Copy link
Collaborator Author

zth commented Feb 17, 2025

Yes:

 We've found a bug for you!
  tst.res:3:12

  1 │ let d = (d:Date.t) => d
  2 │ 
  3 │ let xx = d(1)

  This has type: int
  But this function argument is expecting:
    Stdlib.Date.t (defined as Stdlib_Date.t)

So that needs to be fixed as well. At least I think so.

@cristianoc
Copy link
Collaborator

Yes:

 We've found a bug for you!
  tst.res:3:12

  1 │ let d = (d:Date.t) => d
  2 │ 
  3 │ let xx = d(1)

  This has type: int
  But this function argument is expecting:
    Stdlib.Date.t (defined as Stdlib_Date.t)

So that needs to be fixed as well. At least I think so.

Perhaps it can be handled directly by the type printing in the compiler.

@cknitt cknitt moved this to In progress in ReScript development Mar 6, 2025
@zth zth moved this from In progress to Done in ReScript development Mar 11, 2025
@zth zth closed this as completed by moving to Done in ReScript development Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants