Skip to content

Commit da2776c

Browse files
committed
support trait kind in SymbolInformation
1 parent d927985 commit da2776c

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,12 @@ class ExtractSemanticDB extends Phase {
252252
SymbolInformation.Kind.OBJECT
253253
else if sym.is(Package)
254254
SymbolInformation.Kind.PACKAGE
255-
else if sym.isClass
256-
SymbolInformation.Kind.CLASS
257255
else if sym.isAllOf(JavaInterface)
258256
SymbolInformation.Kind.INTERFACE
259257
else if sym.is(Trait)
260258
SymbolInformation.Kind.TRAIT
259+
else if sym.isClass
260+
SymbolInformation.Kind.CLASS
261261
else if sym.isType
262262
SymbolInformation.Kind.TYPE
263263
else if sym.is(ParamAccessor)

tests/semanticdb/metac.expect

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ annot/B#x. => val method x
216216
annot/M. => final object M
217217
annot/M.m(). => method m
218218
annot/M.m().[TT] => typeparam TT
219-
annot/T# => class T
219+
annot/T# => trait T
220220
annot/T#`<init>`(). => primary ctor <init>
221221
local0 => selfparam self
222222
local1 => val local local
@@ -287,7 +287,7 @@ Occurrences => 34 entries
287287

288288
Symbols:
289289
example/Anonymous# => class Anonymous
290-
example/Anonymous#Foo# => class Foo
290+
example/Anonymous#Foo# => trait Foo
291291
example/Anonymous#Foo#`<init>`(). => primary ctor <init>
292292
example/Anonymous#`<init>`(). => primary ctor <init>
293293
example/Anonymous#foo. => val method foo
@@ -468,7 +468,7 @@ Symbols:
468468
a/Definitions. => final object Definitions
469469
a/Definitions.D# => class D
470470
a/Definitions.D#`<init>`(). => primary ctor <init>
471-
a/Definitions.E# => class E
471+
a/Definitions.E# => trait E
472472
a/Definitions.E#`<init>`(). => primary ctor <init>
473473
a/Definitions.`b_=`(). => var method b_=
474474
a/Definitions.a. => val method a
@@ -900,7 +900,7 @@ flags/p/package.V# => type V
900900
flags/p/package.X. => final case object X
901901
flags/p/package.Y# => final class Y
902902
flags/p/package.Y#`<init>`(). => primary ctor <init>
903-
flags/p/package.Z# => sealed class Z
903+
flags/p/package.Z# => sealed trait Z
904904
flags/p/package.Z#`<init>`(). => primary ctor <init>
905905
flags/p/package.`y_=`(). => var method y_=
906906
flags/p/package.m(). => method m
@@ -1093,7 +1093,7 @@ Occurrences => 52 entries
10931093

10941094
Symbols:
10951095
a/b/Givens. => final object Givens
1096-
a/b/Givens.Monoid# => class Monoid
1096+
a/b/Givens.Monoid# => trait Monoid
10971097
a/b/Givens.Monoid#[A] => typeparam A
10981098
a/b/Givens.Monoid#`<init>`(). => primary ctor <init>
10991099
a/b/Givens.Monoid#combine(). => abstract method combine
@@ -2032,7 +2032,7 @@ Symbols => 6 entries
20322032
Occurrences => 10 entries
20332033

20342034
Symbols:
2035-
example/A# => class A
2035+
example/A# => trait A
20362036
example/A#`<init>`(). => primary ctor <init>
20372037
example/A#foo(). => abstract method foo
20382038
example/B# => class B
@@ -2383,14 +2383,14 @@ local0 => primary ctor <init>
23832383
local1 => selfparam self
23842384
traits/C# => class C
23852385
traits/C#`<init>`(). => primary ctor <init>
2386-
traits/T# => class T
2386+
traits/T# => trait T
23872387
traits/T#`<init>`(). => primary ctor <init>
23882388
traits/T#x(). => method x
2389-
traits/U# => sealed class U
2389+
traits/U# => sealed trait U
23902390
traits/U#`<init>`(). => primary ctor <init>
23912391
traits/U. => final object U
23922392
traits/U.u(). => method u
2393-
traits/V# => class V
2393+
traits/V# => trait V
23942394
traits/V#`<init>`(). => primary ctor <init>
23952395

23962396
Occurrences:
@@ -2461,7 +2461,7 @@ types/Test.C#ClassInfoType1. => final object ClassInfoType1
24612461
types/Test.C#ClassInfoType2# => class ClassInfoType2
24622462
types/Test.C#ClassInfoType2#`<init>`(). => primary ctor <init>
24632463
types/Test.C#ClassInfoType2#x(). => method x
2464-
types/Test.C#ClassInfoType3# => class ClassInfoType3
2464+
types/Test.C#ClassInfoType3# => trait ClassInfoType3
24652465
types/Test.C#ClassInfoType3#[T] => typeparam T
24662466
types/Test.C#ClassInfoType3#`<init>`(). => primary ctor <init>
24672467
types/Test.C#Either. => val method Either
@@ -2532,7 +2532,7 @@ types/Test.Literal.unit. => final val method unit
25322532
types/Test.M# => class M
25332533
types/Test.M#`<init>`(). => primary ctor <init>
25342534
types/Test.M#m(). => method m
2535-
types/Test.N# => class N
2535+
types/Test.N# => trait N
25362536
types/Test.N#`<init>`(). => primary ctor <init>
25372537
types/Test.N#n(). => method n
25382538
types/ann# => class ann

tests/semanticdb/todo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This todolist is based upon blackbox observation of testcases at this repository
77
- [ ] Hide calls to implicit conversions and their arguments
88
- [ ] Hide Tuple contructors
99
- [ ] Hide implicitly applied arguments
10+
- [ ] `macro ???` is already rewritten to `???` so can't add macro kind.
1011
- [x] Assignments to vars should emit uses of the setter method and not the getter
1112
- [x] Hide constructor of module template // expect tests hide primary ctors
1213
- [x] unescape unicode in names.

0 commit comments

Comments
 (0)