generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shire): add FileCreateService and integrate with ShireInput
- Introduce FileCreateService to handle file creation logic. - Update ShireInput to use FileCreateService for creating virtual files. - Move ChatBoxShireFileService to shirelang and refactor as ChatBoxShireFileCreateService.
- Loading branch information
Showing
5 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
core/src/main/kotlin/com/phodal/shirecore/provider/shire/FileCreateService.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,20 @@ | ||
package com.phodal.shirecore.provider.shire | ||
|
||
import com.intellij.lang.Language | ||
import com.intellij.lang.LanguageExtension | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.vfs.VirtualFile | ||
|
||
|
||
interface FileCreateService { | ||
fun createFile(prompt: String, project: Project): VirtualFile? | ||
|
||
companion object { | ||
private val languageExtension: LanguageExtension<FileCreateService> = | ||
LanguageExtension("com.phodal.shireFileCreateService") | ||
|
||
fun provide(language: Language): FileCreateService? { | ||
return languageExtension.forLanguage(language) | ||
} | ||
} | ||
} |
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