-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expose methods used by Scaladoc in Quotes API #13382
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
/** Type member directly declared in the class */ | ||
def typeMembers: List[Symbol] | ||
|
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.
I see there some inconsistency as methodMembers
and fieldMembers
return both declared and inherited members and typeMembers
returns only declared members.
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.
Please update the MiMaFilters
It would be good to split this PR into smaller parts that add or change specific parts of the API |
We need to split this into a PR with for each method or group of methods. We also need to include tests, using it in the docs is not enough as at some point we might change that code and stop using those methods. We can parallelize a bit this effort. |
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.
Needs split
@pikinier20 you should create branches on https://github.com/dotty-staging/dotty, this way we all have access to these branches and it is easier to collaborate. |
II started with |
@@ -2733,6 +2752,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler | |||
def sourceCode: Option[String] = | |||
// TODO detect when we do not have a source and return None | |||
Some(new String(self.source.content(), self.start, self.end - self.start)) | |||
def exists: Boolean = self.exists |
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.
I believe all positions should exist. If one does not we should figure out why it is not set.
@@ -246,6 +246,13 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler | |||
optional(self.rhs.asInstanceOf[tpd.Template].self) | |||
def body: List[Statement] = | |||
self.rhs.asInstanceOf[tpd.Template].body | |||
def tpe: TypeRepr = | |||
self.symbol.typeRef.appliedTo(self.symbol.typeParams.map(_.typeRef)) |
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.
Applying this type to the types refs of the parameter symbol seems wrong. Not sure what the resulting type represents.
I've split this PR into smaller parts |
closes #13371
Probably needs to write some documentation to added API