Skip to content

Commit 26f502b

Browse files
committed
Optimize as type element
1 parent 1251066 commit 26f502b

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

core/src/main/kotlin/cn/enaium/jimmer/buddy/JimmerBuddy.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ object JimmerBuddy {
209209
init = true
210210
project.runWhenSmart {
211211
val projects = findProjects(project.guessProjectDir()?.toNioPath()!!)
212-
CoroutineScope(Dispatchers.Default).launch {
212+
CoroutineScope(Dispatchers.IO).launch {
213213
log.info("Project ${project.name} is initializing")
214214
if (project.isJavaProject()) {
215215
sourcesProcessJava(
@@ -499,8 +499,6 @@ object JimmerBuddy {
499499
kotlinImmutableKtClassCache
500500
)
501501
try {
502-
503-
504502
val kspOptions = getKspOptions(project)
505503

506504
log.info("SourcesProcessKotlin Project:${projectDir.name}:${src} KtClassCaches:${kotlinImmutableKtClassCache.size} KSPOptions:${kspOptions}")

core/src/main/kotlin/cn/enaium/jimmer/buddy/extensions/BuddyPsiTreeChange.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ class BuddyPsiTreeChange(val project: Project) : PsiTreeChangeAdapter() {
7272
psiFile.getChildOfType<PsiClass>()?.hasJimmerAnnotation()
7373
} == true) {
7474
it.sourcesProcessJava(
75-
JimmerBuddy.GenerateProject.generate(
75+
GenerateProject.generate(
7676
path,
77-
JimmerBuddy.GenerateProject.SourceRootType.JAVA
77+
GenerateProject.SourceRootType.JAVA
7878
)
7979
)
8080
} else if (path.extension == "dto") {
8181
it.dtoProcessJava(
82-
JimmerBuddy.GenerateProject.generate(
82+
GenerateProject.generate(
8383
path,
84-
JimmerBuddy.GenerateProject.SourceRootType.DTO
84+
GenerateProject.SourceRootType.DTO
8585
)
8686
)
8787
}

core/src/main/kotlin/cn/enaium/jimmer/buddy/extensions/dto/editor/DtoViewerSplitEditor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ import com.intellij.openapi.fileEditor.TextEditorWithPreview
2323
* @author Enaium
2424
*/
2525
class DtoViewerSplitEditor(editor: TextEditor, visual: DtoVisualFileEditor) :
26-
TextEditorWithPreview(editor, visual)
26+
TextEditorWithPreview(editor, visual, "", Layout.SHOW_EDITOR)

core/src/main/kotlin/cn/enaium/jimmer/buddy/utility/DelayedExecutionQueue.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import java.util.concurrent.ConcurrentHashMap
2121

2222
class DelayedExecutionQueue(
2323
private val defaultDelay: Long,
24-
private val coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.Default)
24+
private val coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.IO)
2525
) {
2626
private val tasks = ConcurrentHashMap<String, Job>()
2727

core/src/main/kotlin/cn/enaium/jimmer/buddy/utility/apt.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fun PsiClass.asTypeElement(caches: MutableMap<String, TypeElement> = mutableMapO
185185
},
186186
getAnnotationMirrors = {
187187
this.modifierList?.annotations?.mapNotNull {
188-
it.findAnnotation()?.let {
188+
it.takeIf { it.qualifiedName?.startsWith(jimmerAnnotationPrefixe) == true }?.findAnnotation()?.let {
189189
createAnnotationMirror(
190190
it,
191191
caches

core/src/main/kotlin/cn/enaium/jimmer/buddy/utility/utitlity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,4 @@ fun Project.findKtClass(name: String): KtClass? {
295295
return KotlinFullClassNameIndex[name, this, this.allScope()].firstOrNull() as? KtClass
296296
}
297297

298-
val jimmerAnnotationPrefixe = Scalar::class.java.packageName
298+
val jimmerAnnotationPrefixe: String = Scalar::class.java.packageName

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
kotlin.code.style=official
2-
version=1.10.15
2+
version=1.10.16
33
kotlin.daemon.jvmargs=-Xmx3G
44
org.gradle.jvmargs=-Xmx3G

0 commit comments

Comments
 (0)