Skip to content

Commit bc7f724

Browse files
committed
feat(chat): add IDE version context provider
Introduce IdeVersionChatContextProvider to collect and provide IDE version information as part of the chat context. This enhances context awareness in chat interactions.
1 parent f6271ab commit bc7f724

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

core/src/233/main/resources/META-INF/autodev-core.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@
248248
<bundleName>messages.AutoDevBundle</bundleName>
249249
<categoryKey>intention.category.llm</categoryKey>
250250
</autoDevIntention>
251+
252+
<chatContextProvider implementation="cc.unitmesh.devti.provider.context.IdeVersionChatContextProvider"/>
251253

252254
<langSketchProvider implementation="cc.unitmesh.devti.sketch.ui.patch.DiffLangSketchProvider"/>
253255
<langSketchProvider implementation="cc.unitmesh.devti.sketch.ui.webview.WebpageSketchProvider"/>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cc.unitmesh.devti.provider.context
2+
3+
import com.intellij.openapi.application.ApplicationInfo
4+
import com.intellij.openapi.application.ApplicationNamesInfo
5+
import com.intellij.openapi.project.Project
6+
7+
class IdeVersionChatContextProvider : ChatContextProvider {
8+
override fun isApplicable(project: Project, creationContext: ChatCreationContext) = true
9+
10+
override fun collect(project: Project, creationContext: ChatCreationContext): List<ChatContextItem> {
11+
val productName = ApplicationNamesInfo.getInstance().fullProductName
12+
val ideVersion = ApplicationInfo.getInstance().fullVersion
13+
val ideInfo = "Here is current user's IDE: $productName $ideVersion"
14+
15+
return listOf(ChatContextItem(IdeVersionChatContextProvider::class, ideInfo))
16+
}
17+
}

0 commit comments

Comments
 (0)