Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #183 from sschaef/issue/semantic-highlighting-enhance

Add semantic highlighting for object members in type params
  • Loading branch information...
commit b029fa2bbe8febf317fc6ac7f94ae9199319040d 2 parents 2898c63 + 88132af
Mirco Dotta authored August 18, 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 b029fa2

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