Skip to content

Commit

Permalink
refactor: removes unused previous reference indexing code
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Addazi <[email protected]>
  • Loading branch information
loradd committed Mar 7, 2024
1 parent f0def9e commit a81e05a
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ import java.nio.file.Path
import java.nio.file.Paths
import java.util.UUID
import java.util.concurrent.CompletableFuture
import kotlin.reflect.full.declaredMemberProperties
import kotlin.reflect.full.isSubtypeOf
import kotlin.reflect.jvm.javaField
import kotlin.reflect.typeOf
import kotlin.system.exitProcess

open class KolasuServer<T : Node>(protected open val parser: ASTParser<T>?, protected open val language: String = "", protected open val extensions: List<String> = listOf(), protected open val symbolResolver: SymbolResolver? = null, protected open val generator: CodeGenerator<T>? = null) : LanguageServer, TextDocumentService, WorkspaceService, LanguageClientAware {
Expand Down Expand Up @@ -251,16 +247,6 @@ open class KolasuServer<T : Node>(protected open val parser: ASTParser<T>?, prot
.map { StringField("reference", it, Field.Store.YES) }
.forEach(document::add)

val referenceField = node::class.declaredMemberProperties.find { it.returnType.isSubtypeOf(typeOf<ReferenceByName<*>>()) }
referenceField?.javaField?.let { field ->
field.isAccessible = true
val value = field.get(node) as ReferenceByName<*>

if (value.referred is Node && uuid[value.referred as Node] != null) {
document.add(StringField("reference", uuid[value.referred as Node], Field.Store.YES))
}
}

indexWriter.addDocument(document)
}
commitIndex()
Expand Down

0 comments on commit a81e05a

Please sign in to comment.