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

Show aliased type for singleton completions #6540

Open
nguyenyou opened this issue Jun 25, 2024 · 4 comments
Open

Show aliased type for singleton completions #6540

nguyenyou opened this issue Jun 25, 2024 · 4 comments
Labels
improvement Not a bug or a feature, but something general we can improve presentation-compiler Something relating to the presentation compiler Scala 3 Generic ticket relating to Scala 3

Comments

@nguyenyou
Copy link

Follow up #6498

I create this issue to list all the improvements about value completions for union types.

Named args

image

Expectation: support value completions

Pattern matching

image

Expectation: support value completions

Map

image

Expectation: support value completions

List

image

Expectation: I think just show the value for each suggestion item is enough.

cc @kasiaMarek @tgodzik

@kasiaMarek kasiaMarek added improvement Not a bug or a feature, but something general we can improve Scala 3 Generic ticket relating to Scala 3 presentation-compiler Something relating to the presentation compiler labels Jun 26, 2024
@kasiaMarek kasiaMarek self-assigned this Jun 26, 2024
@kasiaMarek
Copy link
Contributor

Expectation: I think just show the value for each suggestion item is enough.

This part is up for discussion, normally we add the type and it would be an odd inconsistency not to add it. I think the actual problem is that, because of the way that type is extracted, we get it in a dealised form here.

@nguyenyou
Copy link
Author

nguyenyou commented Jun 26, 2024

HI @kasiaMarek,

I think it makes sense to keep things consistent. Can you change it to show the type name? Like we already have here:

Screenshot 2024-06-26 at 18 59 09

If it's somehow a problem that can't be addressed at the moment, then I'm ok to live with it 😄

@kasiaMarek
Copy link
Contributor

Can you change it to show the type name?

That would be the desirable way to show it. The problem is that I'm extracting the "expected" type from the typed tree, and in the list case it is present in the tree already dealised by the compiler. I'd have to somehow alias it back - probably doable by looking at types in the scope, or come up with a better way to deal with this. Not sure how to do it properly yet.

@nguyenyou
Copy link
Author

Please help to decide this 😄 I think this is just a nice to have improvement.

@kasiaMarek kasiaMarek changed the title Value completions for union types improvements Show aliased type for singleton completions Jul 2, 2024
@kasiaMarek kasiaMarek removed their assignment Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug or a feature, but something general we can improve presentation-compiler Something relating to the presentation compiler Scala 3 Generic ticket relating to Scala 3
Projects
None yet
Development

No branches or pull requests

2 participants