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

Support go-to-definition on named arguments #5057

Merged
merged 1 commit into from
Aug 30, 2018

Conversation

Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Aug 29, 2018

No description provided.

funSym.owner.info.member(name).symbol
} else {
val classTree = funSym.topLevelClass.asClass.tree
tpd.defPath(funSym, classTree).lastOption.flatMap {
Copy link
Contributor

Choose a reason for hiding this comment

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

This expression is a bit dense. I believe the following would be slightly longer, but more readable:

val paramSymbol = 
  for {
    DefDef(_, _, paramss, _, _) <- tpd.defPath(funSym, classTree).lastOption
    param <- paramss.flatten.find(_.name == name)
  } yield param.symbol
paramSymbol.getOrElse(fn.symbol)

@odersky odersky merged commit 7a8dd59 into scala:master Aug 30, 2018
@Blaisorblade Blaisorblade deleted the topic/go-to-def-named-args branch August 30, 2018 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants