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

Effects should not be displayed when empty #609

Open
b-studios opened this issue Sep 25, 2024 · 1 comment
Open

Effects should not be displayed when empty #609

b-studios opened this issue Sep 25, 2024 · 1 comment
Labels

Comments

@b-studios
Copy link
Collaborator

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:

val returnType = for {
tpe <- result
eff <- effects
} yield pp": $tpe / $eff"

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

val eff = if (effects.isEmpty) emptyDoc else space <> "/" <+> toDoc(effects)

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

@b-studios b-studios added good first issue Good for newcomers area:lsp labels Sep 25, 2024
@jiribenes
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants