Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add semantic highlighting for object members in type params

Fix #1001209
  • Loading branch information...
commit 88132af2126baa1a2f32971258a542a5f05de965 1 parent 2bbd735
Simon Schäfer authored August 15, 2012
12  org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/semantichighlighting/classifier/ObjectTest.scala
@@ -58,4 +58,16 @@ class ObjectTest extends AbstractSymbolClassifierTest {
58 58
         """,
59 59
       Map("OBJ" -> Object, "PKG" -> Package))
60 60
   }
  61
+
  62
+  @Test
  63
+  def object_member_within_type_param() {
  64
+    checkSymbolClassification("""
  65
+      object TypeA { class TypeB }
  66
+      trait Trait extends Seq[TypeA.TypeB]
  67
+      """, """
  68
+      object TypeA { class TypeB }
  69
+      trait Trait extends $T$[$OBJ$.$CLS$]
  70
+      """,
  71
+      Map("CLS" -> Class, "OBJ" -> Object, "T" -> Type))
  72
+  }
61 73
 }
3  org.scala-ide.sdt.core/src/scala/tools/eclipse/semantichighlighting/classifier/SafeSymbol.scala
@@ -104,6 +104,9 @@ trait SafeSymbol extends CompilerAccess with PimpedTrees {
104 104
     case ExistentialTypeTree(tpt, whereClauses) =>
105 105
       (tpt :: whereClauses).flatMap(safeSymbol)
106 106
 
  107
+    case tpe @ Select(qualifier, _) =>
  108
+      global.askOption(() => tpe.symbol -> tpe.namePosition).toList ::: safeSymbol(qualifier)
  109
+
107 110
     case _ =>
108 111
       // the local variable backing a lazy value is called 'originalName$lzy'. We swap it here for its
109 112
       // accessor, otherwise this symbol would fail the test in `getNameRegion`

0 notes on commit 88132af

Please sign in to comment.
Something went wrong with that request. Please try again.