On Tue, Feb 19, 2013 at 1:53 PM, Iulian Dragos <notifications@github.com>wrote:

> In test/files/presentation/doc/doc.scala:
>
> >
> > -      def getComment(sym: Symbol, source: SourceFile) = {
> > -        val docResponse = new Response[(String, String, Position)]
> > -        askDocComment(sym, sym.owner, source, docResponse)
> > -        docResponse.get.left.toOption flatMap {
> > -          case (expanded, raw, pos) =>
> > -            if (expanded.isEmpty)
> > -              None
> > -            else
> > -              Some(ask { () => parseAtSymbol(expanded, raw, pos, Some(sym.owner)) })
> > -        }
> > +    def getComment(sym: Symbol, source: SourceFile): Option[Comment] = {
> > +      val docResponse = new Response[(String, String, Position)]
> > +      askDocComment(sym, sym.owner, source, docResponse)
> > +      docResponse.get.left.toOption flatMap {
>
> It's right below: if (expanded.isEmpty)... and if not, you call ask( =>
> parseAtSymbol..). I'm wondering if this pattern is necessary each time
> one calls askDocComment, and if it could be encapsulated.
>
Yes, that's how it works. Note that in order to call parseAtSymbol one
needs environment that is not given at the request. I think I explained
that most of the work is done in the request, but parse (ah, bad name it
is) which requires compiler thread is not and is done in 'ask'.

>  —
> Reply to this email directly or view it on GitHub<https://github.com/scala/scala/pull/2106/files#r3059194>.
>
>