effekt-lang / effekt

A language with lexical effect handlers and lightweight effect polymorphism
https://effekt-lang.org
MIT License
334 stars 24 forks source link

Effects should not be displayed when empty #609

Open b-studios opened 2 months ago

b-studios commented 2 months ago

When hovering over a function its full return type and effects are shown.

image

This is in contrast to our usual presentation where we would omit the empty set of effects and just say show returns a String (but not String / {}).

The code that renders function declarations is here:

https://github.com/effekt-lang/effekt/blob/80467d8d942ccd49fb2165261f90ae26b0b7cf0f/effekt/shared/src/main/scala/effekt/symbols/DeclPrinter.scala#L86-L89

and should be adapted to print effects similar to the TypePrinter:

https://github.com/effekt-lang/effekt/blob/80467d8d942ccd49fb2165261f90ae26b0b7cf0f/effekt/shared/src/main/scala/effekt/symbols/TypePrinter.scala#L76

Optional: Maybe some logic between TypePrinter and DeclPrinter can be deduplicated

jiribenes commented 2 months ago

I sort of like this though as it's explicit about the effects a function has. But I'm fine with removing it.