Skip to content

Commit

Permalink
203 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsh committed Nov 3, 2020
1 parent f934ed6 commit bcb21bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<codeInsight.parameterNameHints language="Clojure" implementationClass="org.intellij.clojure.editor.ClojureParamInlayHintsHandler"/>

<filetype.stubBuilder filetype="Clojure" implementationClass="org.intellij.clojure.psi.stubs.ClojureStubBuilder"/>
<stubElementTypeHolder class="org.intellij.clojure.psi.stubs.ClojureStubBuilder"/>
<stubElementTypeHolder class="org.intellij.clojure.psi.stubs.ClojureStubBuilder$Holder" externalIdPrefix="clojure."/>

<fileBasedIndex implementation="org.intellij.clojure.psi.impl.ClojureNSIndex"/>
<fileBasedIndex implementation="org.intellij.clojure.psi.impl.ClojureDefIndex"/>
Expand Down
27 changes: 13 additions & 14 deletions src/lang/clojure-psi-stubs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ class ClojureStubBuilder : BinaryFileStubBuilder {
return buildStubTree(fileContent.psiFile as? CFile ?: return null)
}

companion object {
init {
SerializationManager.getInstance().run {
registerSerializer(CFileStub.SERIALIZER)
registerSerializer(CListStub.SERIALIZER)
registerSerializer(CPrototypeStub.SERIALIZER)
registerSerializer(CMetaStub.SERIALIZER)
registerSerializer(CImportStub.SERIALIZER)
}
@Suppress("unused")
private interface Holder {
companion object {
@JvmField val FILE = CFileStub.SERIALIZER
@JvmField val LIST = CListStub.SERIALIZER
@JvmField val PROTO = CPrototypeStub.SERIALIZER
@JvmField val META = CMetaStub.SERIALIZER
@JvmField val IMPORT = CImportStub.SERIALIZER
}
}
}
Expand All @@ -77,7 +76,7 @@ class CFileStub(val namespace: String) : CStub(null) {
fun registerListStub(child: CListStub) { childMap[child.key] = child }
fun findChildStub(key: SymKey) = childMap[key]

override fun getStubType() = SERIALIZER
override fun getStubType() = SERIALIZER as ObjectStubSerializer<*, Stub>

companion object {
val SERIALIZER = object : ObjectStubSerializer<CFileStub, CStub> {
Expand Down Expand Up @@ -107,7 +106,7 @@ class CListStub(val key: SymKey,
?.registerListStub(this)
}

override fun getStubType() = SERIALIZER
override fun getStubType() = SERIALIZER as ObjectStubSerializer<*, Stub>
override fun toString() = key.toString()

companion object {
Expand All @@ -128,7 +127,7 @@ class CListStub(val key: SymKey,

class CPrototypeStub(val args: List<Arg>, val typeHint: String?, parent: CStub?) : CStub(parent) {

override fun getStubType() = SERIALIZER
override fun getStubType() = SERIALIZER as ObjectStubSerializer<*, Stub>
override fun toString() = args.toString()

companion object {
Expand All @@ -155,7 +154,7 @@ class CPrototypeStub(val args: List<Arg>, val typeHint: String?, parent: CStub?)

class CMetaStub(val map: Map<String, String>, parent: CStub?) : CStub(parent) {

override fun getStubType() = SERIALIZER
override fun getStubType() = SERIALIZER as ObjectStubSerializer<*, Stub>
override fun toString() = map.toString()

companion object {
Expand All @@ -170,7 +169,7 @@ class CMetaStub(val map: Map<String, String>, parent: CStub?) : CStub(parent) {
}

internal class CImportStub(val import: Import, val dialect: Dialect, parent: CStub?) : CStub(parent) {
override fun getStubType() = SERIALIZER
override fun getStubType() = SERIALIZER as ObjectStubSerializer<*, Stub>

companion object {
val SERIALIZER = object : ObjectStubSerializer<CImportStub, CStub> {
Expand Down

0 comments on commit bcb21bd

Please sign in to comment.