Skip to content

Commit

Permalink
feat(harmonyos): update documentation and chat context provider
Browse files Browse the repository at this point in the history
- Updated the documentation in the HarmonyOS Extension README file to include information about the remote API being used.
- Modified the HarmonyOSChatContextProvider to provide more context information.
- The context now includes the main language used (TypeScript, JavaScript, or ArkTS) and mentions the Flutter-like UI framework being used.
- This will enhance the user experience when working with HarmonyOS projects.
  • Loading branch information
phodal committed Feb 24, 2024
1 parent 37f323d commit 91317d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion exts/ext-harmonyos/README.md
@@ -1,8 +1,10 @@
# HarmonyOS Extension

openharmony/lib/ohos-info-center-plugin-3.1.0.501, API Reference
openharmony/lib/ohos-info-center-plugin-3.1.0.501, API Reference,可惜使用的是远程 API 。
openharmony/lib/javascript-3.1.0.501.jar, 自研 JavaScript 模块



## 设计思念

三个新要素:新的语言、遗留系统迁移、新的 UI 框架。
Expand Down
Expand Up @@ -11,6 +11,14 @@ class HarmonyOSChatContextProvider : ChatContextProvider {
}

override suspend fun collect(project: Project, creationContext: ChatCreationContext): List<ChatContextItem> {
return listOf(ChatContextItem(HarmonyOSChatContextProvider::class, "This project is a HarmonyOS project."))
var context = "This project is a HarmonyOS project."

val languageName = creationContext.element?.language?.displayName

if (languageName == "TypeScript" || languageName == "JavaScript" || languageName == "ArkTS") {
context += "Which use TypeScript as the main language, and use Flutter like UI framework."
}

return listOf(ChatContextItem(HarmonyOSChatContextProvider::class, context))
}
}

0 comments on commit 91317d1

Please sign in to comment.