@@ -318,10 +318,22 @@ class SemanticdbConsumer extends TastyConsumer {
318
318
localsymbol
319
319
}
320
320
} else {
321
- println(" golbal : " , symbol)
321
+ println(" global : " , symbol)
322
322
iterateParent(symbol)
323
323
}
324
-
324
+ /* println(symbol, symbol.isUselessOccurrence)
325
+
326
+ println(symbol, "isWildCard", symbol.isWildCard)
327
+ println(symbol, "isAnonymousCl", symbol.isAnonymousClass)
328
+ println(symbol, "isAnonymousFun", symbol.isAnonymousFunction)
329
+ println(symbol, "isSyntheticCon", symbol.isSyntheticConstructor)
330
+ println(symbol, "isStaticConstr", symbol.isStaticConstructor)
331
+ println(symbol, "isLocalChil", symbol.isLocalChild)
332
+ println(symbol, "isSyntheticVal", symbol.isSyntheticValueClassCompanion)
333
+ println(symbol, "isUselessFie", symbol.isUselessField)
334
+ println(symbol, "isSyntheticCas", symbol.isSyntheticCaseAccessor)
335
+ println(symbol, "isRefinementCl", symbol.isRefinementClass)
336
+ println(symbol, "isSyntheticJav", symbol.isSyntheticJavaModule)*/
325
337
if (symbol_path == " " || symbol.isUselessOccurrence) return
326
338
327
339
occurrences =
@@ -482,7 +494,9 @@ class SemanticdbConsumer extends TastyConsumer {
482
494
}*/
483
495
484
496
override def traverseTree (tree : Tree )(implicit ctx : Context ): Unit = {
485
- // println(tree.pos.startColumn, tree.symbol.name, tree.pos.endColumn)
497
+ println(" \n " )
498
+ println(tree)
499
+ println(tree.pos.startColumn, tree.symbol.name, tree.pos.endColumn)
486
500
tree match {
487
501
case Import (path, selectors) =>
488
502
val key = (tree.symbol.name, tree.pos.start)
@@ -525,7 +539,8 @@ class SemanticdbConsumer extends TastyConsumer {
525
539
}
526
540
if (tree.symbol.name != " <none>" ) {
527
541
val range_symbol = range(tree, tree.symbol.pos, tree.symbol.name)
528
- /* if (tree.symbol.name == "<init>" && !tree.isUserCreated && !tree.symbol.owner.flags.is(Flags.Object) ) {
542
+ if (tree.symbol.name == " <init>" && ! tree.isUserCreated && ! tree.symbol.owner.flags.is(Flags .Object ) ) {
543
+ println(" YES" )
529
544
val range_symbol2 = s.Range (range_symbol.startLine,
530
545
range_symbol.startCharacter - 4 ,
531
546
range_symbol.endLine,
@@ -535,7 +550,7 @@ class SemanticdbConsumer extends TastyConsumer {
535
550
range_symbol2,
536
551
true )
537
552
538
- } else */ {
553
+ } else {
539
554
addOccurenceTree(tree,
540
555
s.SymbolOccurrence .Role .DEFINITION ,
541
556
range_symbol)
@@ -551,12 +566,10 @@ class SemanticdbConsumer extends TastyConsumer {
551
566
}
552
567
553
568
case Term .Ident (name) => {
554
- // To avoid adding the identifier of the package symbol
555
- if (tree.symbol.owner.name != " <root>" ) {
556
- addOccurenceTree(tree,
557
- s.SymbolOccurrence .Role .REFERENCE ,
558
- range(tree, tree.pos, tree.symbol.name))
559
- }
569
+ addOccurenceTree(tree,
570
+ s.SymbolOccurrence .Role .REFERENCE ,
571
+ range(tree, tree.pos, tree.symbol.name))
572
+
560
573
super .traverseTree(tree)
561
574
}
562
575
case PackageClause (_) =>
@@ -575,6 +588,7 @@ class SemanticdbConsumer extends TastyConsumer {
575
588
}
576
589
577
590
}
591
+ println(root)
578
592
Traverser .traverseTree(root)(reflect.rootContext)
579
593
}
580
594
0 commit comments