From 856e0b94af6e7429ff43b2884ae9a79dca26c50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Fri, 10 Oct 2014 14:43:44 +0200 Subject: [PATCH] Fix thread check failure in reporting string of Implicit Highlighter Fixes #1002295. --- .../implicits/ImplicitHighlightingPresenter.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/org.scala-ide.sdt.core/src/org/scalaide/ui/internal/editor/decorators/implicits/ImplicitHighlightingPresenter.scala b/org.scala-ide.sdt.core/src/org/scalaide/ui/internal/editor/decorators/implicits/ImplicitHighlightingPresenter.scala index 642462606b..12ef70adff 100644 --- a/org.scala-ide.sdt.core/src/org/scalaide/ui/internal/editor/decorators/implicits/ImplicitHighlightingPresenter.scala +++ b/org.scala-ide.sdt.core/src/org/scalaide/ui/internal/editor/decorators/implicits/ImplicitHighlightingPresenter.scala @@ -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) }