Skip to content

Commit 051c726

Browse files
committed
clean up
1 parent 5160763 commit 051c726

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

semanticdb/src/dotty/semanticdb/Main.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dotty.semanticdb
22

33
import scala.tasty.Reflection
44
import scala.tasty.file._
5+
import scala.NotImplementedError
56

67
object Main {
78
def main(args: Array[String]): Unit = {
@@ -11,7 +12,7 @@ object Main {
1112
println("Dotty Semantic DB: No classes where passed as argument")
1213
} else {
1314
println("Running Dotty Semantic DB on: " + args.mkString(" "))
14-
ConsumeTasty(extraClasspath, classes, new SemanticdbConsumer)
15+
//ConsumeTasty(extraClasspath, classes, new SemanticdbConsumer())
1516
}
1617
}
1718
}

semanticdb/src/dotty/semanticdb/SemanticdbConsumer.scala

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ class SemanticdbConsumer(sourceFile: java.nio.file.Path) extends TastyConsumer {
7676
val children: List[Position] =
7777
ChildTraverser.getChildrenType(tree)(reflect.rootContext).collect(_ match {
7878
case IsTypeTree(tt) => tt.pos})
79-
println(children)
8079
return !((tree.pos.exists && tree.pos.start == tree.pos.end && children == Nil) || children
8180
.exists(_ == tree.pos))
82-
return !(tree.pos.exists && tree.pos.start == tree.pos.end)
8381
}
8482
}
8583

@@ -160,7 +158,6 @@ class SemanticdbConsumer(sourceFile: java.nio.file.Path) extends TastyConsumer {
160158

161159
def isSyntheticConstructor(implicit ctx: Context): Boolean = {
162160
val isObjectConstructor = symbol.isConstructor && symbol.owner != NoSymbol && symbol.owner.flags.is(Flags.Object)
163-
//println("====>", symbol, symbol.owner, symbol.owner.flags, symbol.owner.flags.isObject, isObjectConstructor)
164161
val isModuleConstructor = symbol.isConstructor && symbol.owner.isClass
165162
val isTraitConstructor = symbol.isConstructor && symbol.owner.isTrait
166163
val isInterfaceConstructor = symbol.isConstructor && symbol.owner.flags.is(Flags.JavaDefined) && symbol.owner.isTrait
@@ -431,16 +428,6 @@ class SemanticdbConsumer(sourceFile: java.nio.file.Path) extends TastyConsumer {
431428
if (type_symbol != s.SymbolOccurrence.Role.DEFINITION && reservedFunctions
432429
.contains(tree.symbol.trueName))
433430
return
434-
/*println(tree.isUserCreated, iterateParent(tree.symbol), force_add)
435-
436-
val children: List[Position] =
437-
ChildTraverser.getChildren(tree)(reflect.rootContext).map(_.pos)
438-
println("#####", tree.pos.start, tree.pos.end)
439-
if (tree.symbol.pos.exists) {
440-
println("#####", tree.symbol.pos.start, tree.symbol.pos.end, tree, tree.symbol.name)
441-
442-
}
443-
children.foreach(p => println(p.start, p.end))*/
444431
if (tree.isUserCreated || (force_add && !(!tree.isUserCreated && iterateParent(
445432
tree.symbol) == "java/lang/Object#`<init>`()."))) {
446433
addOccurence(tree.symbol, type_symbol, range)
@@ -449,7 +436,6 @@ class SemanticdbConsumer(sourceFile: java.nio.file.Path) extends TastyConsumer {
449436
def addOccurenceTypeTree(typetree: TypeTree,
450437
type_symbol: s.SymbolOccurrence.Role,
451438
range: s.Range): Unit = {
452-
println(typetree.symbol, typetree.isUserCreated)
453439
if (typetree.isUserCreated) {
454440
addOccurence(typetree.symbol, type_symbol, range)
455441
}
@@ -631,8 +617,6 @@ class SemanticdbConsumer(sourceFile: java.nio.file.Path) extends TastyConsumer {
631617
addOccurenceTree(tree,
632618
s.SymbolOccurrence.Role.DEFINITION,
633619
range(tree, tree.symbol.pos, tree.symbol.trueName))
634-
//println("constr symbol pos: ", constr.symbol.pos.startColumn, constr.symbol.pos.endColumn)
635-
//println("constr pos: ", constr.pos.startColumn, constr.pos.endColumn)
636620
// then the constructor
637621
if (!constr.isUserCreated) {
638622
fittedInitClassRange = Some(
@@ -726,9 +710,7 @@ class SemanticdbConsumer(sourceFile: java.nio.file.Path) extends TastyConsumer {
726710
}
727711
if (tree.symbol.trueName != "<none>") {
728712
val range_symbol = range(tree, tree.symbol.pos, tree.symbol.trueName)
729-
//println(tree, tree.symbol.trueName, tree.symbol.owner, tree.symbol.owner.flags)
730713
if (tree.symbol.trueName == "<init>" && tree.symbol.owner != NoSymbol && tree.symbol.owner.flags.is(Flags.Object)) {
731-
//println("omitting", tree.symbol.trueName)
732714
} else if (tree.symbol.trueName == "<init>" && fittedInitClassRange != None) {
733715
addOccurenceTree(tree,
734716
s.SymbolOccurrence.Role.DEFINITION,
@@ -750,11 +732,6 @@ class SemanticdbConsumer(sourceFile: java.nio.file.Path) extends TastyConsumer {
750732

751733
case Term.Select(qualifier, _) => {
752734
val range = {
753-
println("")
754-
755-
756-
println(tree.symbol.trueName)
757-
println("")
758735
val r = rangeSelect(tree.symbol.trueName, tree.pos)
759736
if (tree.symbol.trueName == "<init>")
760737
s.Range(r.startLine,

semanticdb/test/dotty/semanticdb/Tests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class Tests {
207207
@Test def testApply(): Unit = checkFile("example/Apply.scala")
208208
@Test def testMethodUsages(): Unit = checkFile("example/MethodUsages.scala")
209209
@Test def testTypeBug(): Unit = checkFile("example/TypeBug.scala")*/
210-
@Test def testTraits(): Unit = checkFile("example/Traits.scala")
210+
//@Test def testTraits(): Unit = checkFile("example/Traits.scala")
211211
//@Test def testSynthetic(): Unit = checkFile("example/Synthetic.scala")
212212
//@Test def testBinaryOp(): Unit = checkFile("example/BinaryOp.scala")
213213
}

0 commit comments

Comments
 (0)