generated from JetBrains/intellij-platform-plugin-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
49 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
pycharm/src/main/kotlin/cc/unitmesh/pycharm/PythonFrameworkContextProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package cc.unitmesh.pycharm | ||
|
||
import cc.unitmesh.devti.provider.context.ChatContextItem | ||
import cc.unitmesh.devti.provider.context.ChatContextProvider | ||
import cc.unitmesh.devti.provider.context.ChatCreationContext | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.project.modules | ||
import com.jetbrains.python.PythonLanguage | ||
import com.jetbrains.python.sdk.configuration.PyProjectSdkConfigurationExtension | ||
|
||
class PythonFrameworkContextProvider: ChatContextProvider { | ||
override fun isApplicable(project: Project, creationContext: ChatCreationContext): Boolean { | ||
println(creationContext.element?.language) | ||
return creationContext.element?.language is PythonLanguage | ||
} | ||
|
||
override suspend fun collect(project: Project, creationContext: ChatCreationContext): List<ChatContextItem> { | ||
project.modules.asSequence() | ||
.map { PyProjectSdkConfigurationExtension.findForModule(it) } | ||
.forEach { println(it) } | ||
|
||
return listOf() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters