-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove Documentation type from Reflect #10608
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
Remove Documentation type from Reflect #10608
Conversation
Removing the |
@abgruszecki this PR needs to be rebased |
7f51b39
to
d26e8b6
Compare
@@ -2294,14 +2294,14 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler | |||
def pos: Option[Position] = | |||
if self.exists then Some(self.sourcePos) else None | |||
|
|||
def documentation: Option[Documentation] = | |||
def docstring: Option[String] = |
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.
def docstring: Option[String] = | |
def docString: Option[String] = |
@@ -3070,7 +3068,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => | |||
def pos: Option[Position] | |||
|
|||
/** The documentation for this symbol, if any */ | |||
def documentation: Option[Documentation] | |||
def docstring: Option[String] |
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.
def docstring: Option[String] | |
def docString: Option[String] |
def documentation = sym.documentation match | ||
case Some(comment) => | ||
Map(ctx.sourceSet -> parseComment(comment, sym.tree)) | ||
def documentation = sym.docstring match |
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.
def documentation = sym.docstring match | |
def documentation = sym.docString match |
@@ -21,8 +21,8 @@ class DocumentationInspector extends TastyInspector { | |||
|
|||
override def traverseTree(tree: Tree)(owner: Symbol): Unit = tree match { | |||
case tree: Definition => | |||
tree.symbol.documentation match { | |||
case Some(doc) => println(doc.raw) | |||
tree.symbol.docstring match { |
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.
tree.symbol.docstring match { | |
tree.symbol.docString match { |
@nicolasstucki https://www.google.com/search?hl=en&q=docstring |
It is the only method that is not camelCase in this API. |
It is in camel case, it's just that it's spelled |
ok |
Nothing but the .raw field is set when we load documentation from Tasty. It doesn't make sense to expose Documentation as a separate data type.
d26e8b6
to
eae6d18
Compare
Nothing but the .raw field is set when we load documentation from Tasty. Right now, it doesn't make sense to expose
Documentation
as a separate type.It might make sense to expose it later when we decide how exactly we expose cooking comments.