unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.65k stars 266 forks source link

Docs on Unison Share no longer shorten names for data constructors #4300

Open rlmark opened 10 months ago

rlmark commented 10 months ago

Mentioned in this slack thread

The website and Unison Share now render the full paths to data types whereas before it would abbreviate them the shortest possible path.

Here's an example on Unison share: https://share.unison-lang.org/@unison/website/code/main/latest/terms/learn/fundamentals/dataTypes/uniqueAndStructuralTypes

pchiusano commented 10 months ago

@ChrisPenner can you take a look at this one? Or delegate to someone who you think knows this code better if that's not you.

CleanShot 2023-09-01 at 11 19 32@2x

The current logic for computing constructor names is now (as of this PR) supposed to be - take the FQN of the type, and the FQN of the constructor, and subtract the FQN of the type from the prefix of the constructor. So if the type is blah.foo.oog.Yay and the constructor is blah.foo.oog.Yay.Uno, the constructor will print as Uno.

This is how it's being done locally from the view command, but it looks like the local UI and share are using a different code path?

CleanShot 2023-09-01 at 11 22 06@2x

Looks good. But then check the local UI:

CleanShot 2023-09-01 at 11 21 52@2x

Also console doc rendering handles it okay (although it's stripping the FQN from the type, looks like):

CleanShot 2023-09-01 at 11 28 41@2x
ChrisPenner commented 10 months ago

Not sure what's happening here but should be able to figure it out; my plate is a bit full at the moment so if I don't get to it in a couple weeks please ping me again :)

aryairani commented 2 months ago

This one is still happening even though #4330 is not.