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

[Scala 3] Add match/case completions #3950

Closed
tgodzik opened this issue Jan 21, 2021 · 0 comments
Closed

[Scala 3] Add match/case completions #3950

tgodzik opened this issue Jan 21, 2021 · 0 comments
Assignees
Labels
feature-request Used for feature requests presentation-compiler Something relating to the presentation compiler Scala 3 Generic ticket relating to Scala 3

Comments

@tgodzik
Copy link
Contributor

tgodzik commented Jan 21, 2021

Is your feature request related to a problem? Please describe.
In Scala 2 it's possible to have proper completions on writing any part of the match word. It would be good to have the same for Scala 3

Describe the solution you'd like
The potential solutions should take a look at MatchCaseCompletions and related tests to see what needs to be supported but in general we would need:

  • simple blank match case completion
  • exhaustive matches
  • type match completions
  • exhaustive type match completions (?)

Describe alternatives you've considered

Write it manually.

Additional context
This is part of the effort to create proper tooling for Scala 3.

Search terms:
match case completions scala3

@tgodzik tgodzik added the scala3 label Jan 21, 2021
@tgodzik tgodzik transferred this issue from scalameta/metals-feature-requests May 25, 2022
@tgodzik tgodzik added feature-request Used for feature requests Scala 3 Generic ticket relating to Scala 3 presentation-compiler Something relating to the presentation compiler and removed scala3 labels May 25, 2022
@jkciesluk jkciesluk self-assigned this Jul 27, 2022
tgodzik pushed a commit that referenced this issue Sep 6, 2022
This PR adds support for case keyword completions and exhaustive match completions for scala 3, so they work the same as in scala 2.
It also adds support for completions on pattern only, e.g. case So@@ or case _: So@@ (here we suggest only typed completions) (in scala 2 in such cases we use completions given by compiler, maybe we can change it to work like here)

Connected to #3950

* Change order of advanced completions

Before in 3.1.0 cases like in `exhaustive-sorting` were counted as override completions

* Add MetalsSealedDesc

Add this for specific versions of scala, because we don't have sealedStrictDescendants
in 3.0.0, so we need to use children for match/case completions instead
@tgodzik tgodzik closed this as completed Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Used for feature requests 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