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

bugfix: emit type for enum cases when needed #5501

Merged
merged 2 commits into from Aug 7, 2023

Conversation

kasiaMarek
Copy link
Contributor

@kasiaMarek kasiaMarek commented Aug 1, 2023

  1. emit type and params for enum cases when it has some parameters' list in ScalaMtags
  2. emit type and and val params for enum cases when it has some parameters' list in ScalaTopLevelMtags
  3. when finding a correct file in symbol index fallback to companion class as alternative

resolves: #5494

Copy link
Member

@jkciesluk jkciesluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! I think there is a problem with type parameters, but it doesn’t need to be solved in this PR:

enum MyOption/*TypeEnum.scala*/[+/*<no symbol>*/A/*TypeEnum.scala*/]:
  case MySome/*TypeEnum.scala*/(value/*TypeEnum.scala*/: A/*<no file>*/)
  case MyNone/*TypeEnum.scala*/

A in MySome isn't connected to A in MyOption. This issue is also present in PC, since things like highlight don't work either

@kasiaMarek kasiaMarek force-pushed the enum-case-type branch 2 times, most recently from 40d7a1e to 6759091 Compare August 3, 2023 09:26
@kasiaMarek kasiaMarek requested a review from tgodzik August 3, 2023 12:11
@kasiaMarek kasiaMarek requested a review from tgodzik August 7, 2023 08:24
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kasiaMarek kasiaMarek merged commit 5fefeff into scalameta:main Aug 7, 2023
23 checks passed
@jkciesluk jkciesluk modified the milestone: Metals v1.0.1 Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

incorrect go-to definitions for scala3 enums
3 participants