-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Semi-Fix scaladoc of extensions methods #14321
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
Conversation
Uses the assumption that there is the following "pos hierachy": extension paramss < DefDef < extMethod paramss
19ef092 to
36b5c8a
Compare
| def nonUsingClauses(clauses: List[reflect.ParamClause]) = clauses.zipWithIndex.collect{case (terms: reflect.TermParamClause, i) if !terms.isGiven => (terms, i)} | ||
| val extNonUsingClause = nonUsingClauses(extPart) | ||
| val defNonUsingClauses = nonUsingClauses(defPart) | ||
| assert(extNonUsingClause.size == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assert seems to be causing some of the tests to fail, but I don't understand why
| val termParamss = sym.tree.asInstanceOf[DefDef].termParamss | ||
| if sym.isLeftAssoc || termParamss.size == 1 then termParamss(0).params(0) | ||
| else termParamss(1).params(0) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extendedSymbol should probably also be updated, as it implicitly uses the old heuristic
…4810) Before this changes, it wouldn't generate due to incorrect extension parameters extractor functions. It also implements new heuristic to distinct extensions and method parameters based on definition position. Also fixed type parameter coloring by adding new css rule, to match doc style. Based on #14321 , it should be closed after this PR is merged. Documentation for test `tests.extensionParams` 
This changes the heuristic used by scaladoc to one I was not able to fault (smarter people might)
(à propos, the main idea behind the heuristic was @smarter's)
Note that it is not enough for tests to pass, as
unwrapMemberInfois also incorrect, but I do not have the time to fix itThe commits are neatly split and annotated, so it should be relatively easy to understand what I did
I left some commented
printlns, they highlight that the new heuristic works correctly, and howunwrapMemberInfois incorrect, for example withf1from the rehabilitated testextensionParams:file:
cleaned up output: