新版IDEA 要求不要用构造方法注入
- Dominant language
- Kotlin
- Stars
- 30.8k
- Forks
- 8k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
```
java.lang.Throwable: Do not use constructor injection (requestorClass=com.alibaba.p3c.idea.component.AliProjectComponent)
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:78)
at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:1041)
at com.intellij.serviceContainer.MyComponentAdapter.doCreateInstance(MyComponentAdapter.kt:36)
at com.intellij.serviceContainer.BaseComponentAdapter.doCreateInstance(BaseComponentAdapter.kt:154)
at com.intellij.serviceContainer.BaseComponentAdapter.createInstance$lambda$1(BaseComponentAdapter.kt:133)
at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:99)
at com.intellij.serviceContainer.BaseComponentAdapter.createInstance(BaseComponentAdapter.kt:132)
at com.intellij.serviceContainer.BaseComponentAdapter.access$createInstance(BaseComponentAdapter.kt:19)
at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invokeSuspend(BaseComponentAdapter.kt:181)
at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt)
at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceAsync(BaseComponentAdapter.kt:176)
at com.intellij.serviceContainer.ComponentManagerImpl.createComponentsNonBlocking(ComponentManagerImpl.kt:469)
at com.intellij.openapi.project.impl.ProjectImpl.access$createComponentsNonBlocking(ProjectImpl.kt:57)
at com.intellij.openapi.project.impl.ProjectImpl$Companion$preloadServicesAndCreateComponents$2.invokeSuspend(ProjectImpl.kt:103)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at com.alibaba.p3c.idea.component.AliProjectComponent and trace how it is instantiated, using constructorInjection.kt:78 and the surrounding IntelliJ service-container stack as context. Done means the plugin loads in the newer IDEA without the constructor-injection error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100