Skip to content

Commit

Permalink
fix: fix services error issues
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jul 22, 2023
1 parent 65f54cf commit e8fccbb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Expand Up @@ -4,7 +4,6 @@ import cc.unitmesh.devti.context.model.DtClass
import cc.unitmesh.idea.formatPsi
import cc.unitmesh.idea.fromJavaFile
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.components.Service
import com.intellij.openapi.project.Project
import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.PsiClass
Expand All @@ -13,7 +12,6 @@ import com.intellij.psi.PsiImportStatementBase
import com.intellij.psi.impl.source.PsiJavaFileImpl
import com.intellij.psi.search.GlobalSearchScope

@Service(Service.Level.PROJECT)
class MvcContextService(private val project: Project) {
private val searchScope = GlobalSearchScope.allScope(project)
private val javaPsiFacade = JavaPsiFacade.getInstance(project)
Expand Down
Expand Up @@ -45,7 +45,7 @@ class JvmIdeaContextPrompter : ContextPrompter() {
) {
super.initContext(actionType, selectedText, file, project, offset)
changeListManager = ChangeListManagerImpl.getInstance(project)
mvcContextService = project.service<MvcContextService>()
mvcContextService = MvcContextService(project)

lang = file?.language?.displayName ?: ""
fileName = file?.name ?: ""
Expand Down
Expand Up @@ -24,6 +24,7 @@ class DevtiFlowToolWindowFactory : ToolWindowFactory, DumbAware {
val chatCodingService = ChatCodingService(ChatBotActionType.EXPLAIN, project!!)
val contentPanel = ChatCodingComponent(chatCodingService)
val content = contentFactory.createContent(contentPanel, AutoDevBundle.message("autodev.flow"), false)
// config tool window title
toolWindow.contentManager.addContent(content)
}
}

0 comments on commit e8fccbb

Please sign in to comment.