Skip to content

Commit a0c228b

Browse files
committed
feat(devins-lang): add support for WRITE command #101
- The `WRITE` command is added to the `BuiltinCommandProvider` class. - The `WRITE` command allows writing content to a file. - The command format is `/write:path/to/file:L1-L2`. - This feature enhances the functionality of the DevIns language.
1 parent db8c7fe commit a0c228b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/DevInCompletionContributor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DevInCompletionContributor : CompletionContributor() {
2121
extend(CompletionType.BASIC, PlatformPatterns.psiElement(DevInTypes.COMMAND_ID), BuiltinCommandProvider())
2222
extend(
2323
CompletionType.BASIC,
24-
(valuePatterns(listOf(BuiltinCommand.FILE, BuiltinCommand.RUN))),
24+
(valuePatterns(listOf(BuiltinCommand.FILE, BuiltinCommand.RUN, BuiltinCommand.WRITE))),
2525
FileReferenceLanguageProvider()
2626
)
2727
extend(

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/BuiltinCommandProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ enum class BuiltinCommand(
1717
FILE("file", "Read the content of a file", AllIcons.Actions.AddFile, true, true),
1818
REV("rev", "Read git change by file", AllIcons.Vcs.History, true, true),
1919
SYMBOL("symbol", "Read content by Java/Kotlin canonicalName", AllIcons.Actions.GroupBy, false),
20-
WRITE("write", "Write content to a file, /write:/path/to/file:L1-L2", AllIcons.Actions.Edit, true),
21-
PATCH("patch", "Apply patch to a file, /patch:/path/to/file", AllIcons.Vcs.Patch_file, false),
20+
WRITE("write", "Write content to a file, /write:path/to/file:L1-L2", AllIcons.Actions.Edit, true, true),
21+
PATCH("patch", "Apply patch to a file, /patch:path/to/file", AllIcons.Vcs.Patch_file, false),
2222
RUN("run", "Run the content of a file", AllIcons.Actions.Execute, false),
2323
COMMIT("commit", "Commit the content of a file", AllIcons.Vcs.CommitNode, false)
2424
;

0 commit comments

Comments
 (0)