File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
server/src/main/kotlin/org/javacs/kt/index Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,20 @@ class SymbolIndex {
41
41
transaction(db) {
42
42
Symbols .deleteAll()
43
43
44
+ // TODO: Workaround, since insertIgnore seems to throw UnsupportedByDialectExceptions
45
+ // when used with H2.
46
+ val addedFqns = mutableSetOf<FqName >()
47
+
44
48
for (descriptor in descriptors) {
45
49
val fqn = descriptor.fqNameSafe
46
50
47
- Symbols .insertIgnore {
48
- it[fqName] = fqn.toString()
49
- it[shortName] = fqn.shortName().toString()
50
- it[kind] = descriptor.accept(ExtractSymbolKind , Unit ).rawValue
51
+ if (! addedFqns.contains(fqn)) {
52
+ addedFqns.add(fqn)
53
+ Symbols .insert {
54
+ it[fqName] = fqn.toString()
55
+ it[shortName] = fqn.shortName().toString()
56
+ it[kind] = descriptor.accept(ExtractSymbolKind , Unit ).rawValue
57
+ }
51
58
}
52
59
}
53
60
You can’t perform that action at this time.
0 commit comments