Skip to content

Commit

Permalink
Fix thread check failure in reporting string of Implicit Highlighter
Browse files Browse the repository at this point in the history
Fixes #1002295.
  • Loading branch information
François Garillot committed Oct 10, 2014
1 parent 628fbb7 commit 856e0b9
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -59,11 +59,13 @@ object ImplicitHighlightingPresenter {
val txt = new String(sourceFile.content, t.pos.start, math.max(0, t.pos.end - t.pos.start)).trim()
val pos = mkPosition(t.pos, txt)
val region = new Region(pos.offset, pos.getLength)
val sname = scu.withSourceFile((_, compiler) => compiler.asyncExec{t.fun.symbol.name}.getOption()).flatten
val annotation = new ImplicitConversionAnnotation(
() => compiler.mkHyperlink(t.symbol, name = "Open Implicit", region, scu.scalaProject.javaProject),
s"Implicit conversion found: `$txt`$DisplayStringSeparator`${sname.getOrElse("")}($txt): ${t.tpe}`")
val msg = compiler.asyncExec{
val sname = t.fun.symbol.nameString
s"Implicit conversion found: `$txt`$DisplayStringSeparator`$sname($txt): ${t.tpe}`"
}.getOption()

val annotation = new ImplicitConversionAnnotation(
() => compiler.mkHyperlink(t.symbol, name = "Open Implicit", region, scu.scalaProject.javaProject), msg.getOrElse(""))
(annotation, pos)
}

Expand Down

0 comments on commit 856e0b9

Please sign in to comment.