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

improvement:don't show types for match case for showInferredType #5284

Merged
merged 9 commits into from
Jul 21, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ final class SyntheticsDecorationProvider(
case param: m.Term.Param =>
if (param.decltpe.isEmpty) List(param.name.pos.toSemanticdb) else Nil
case cs: m.Case =>
explorePatterns(List(cs.pat)) ++ visit(cs.body)
// if the case is too long then it'll be too messy
visit(cs.body) // explorePatterns(List(cs.pat)) ++ visit(cs.body)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't agree about removing this, since it might be useful to know the type in case.

We might be over eager in case of inferred type for methods, we could for sure separate it under another flag (or rethink the settings here to be more useful).

Any other opininos?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could also be nice to provide more options like showInferredType = minimal| full | etc...

Copy link
Member

Choose a reason for hiding this comment

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

+1 for more granularity

case vl: m.Defn.Val =>
val values =
if (vl.decltpe.isEmpty) explorePatterns(vl.pats) else Nil
Expand Down