Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 dotta authored
12 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/semantichighlighting/classifier/ObjectTest.scala
View
@@ -58,4 +58,16 @@ class ObjectTest extends AbstractSymbolClassifierTest {
""",
Map("OBJ" -> Object, "PKG" -> Package))
}
+
+ @Test
+ def object_member_within_type_param() {
+ checkSymbolClassification("""
+ object TypeA { class TypeB }
+ trait Trait extends Seq[TypeA.TypeB]
+ """, """
+ object TypeA { class TypeB }
+ trait Trait extends $T$[$OBJ$.$CLS$]
+ """,
+ Map("CLS" -> Class, "OBJ" -> Object, "T" -> Type))
+ }
}
3  org.scala-ide.sdt.core/src/scala/tools/eclipse/semantichighlighting/classifier/SafeSymbol.scala
View
@@ -104,6 +104,9 @@ trait SafeSymbol extends CompilerAccess with PimpedTrees {
case ExistentialTypeTree(tpt, whereClauses) =>
(tpt :: whereClauses).flatMap(safeSymbol)
+ case tpe @ Select(qualifier, _) =>
+ global.askOption(() => tpe.symbol -> tpe.namePosition).toList ::: safeSymbol(qualifier)
+
case _ =>
// the local variable backing a lazy value is called 'originalName$lzy'. We swap it here for its
// accessor, otherwise this symbol would fail the test in `getNameRegion`
Please sign in to comment.
Something went wrong with that request. Please try again.