Skip to content

Commit 3c00fa1

Browse files
committed
fix(commands): disable certain builtin commands by default
- Disable `BROWSE`, `localSearch`, `related`, and `RIPGREP_SEARCH` commands by default. - Add `SHELL` command to the list of supported commands in `DevInsCompiler`.
1 parent 5b5fcfa commit 3c00fa1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

core/src/main/kotlin/cc/unitmesh/devti/devin/dataprovider/BuiltinCommand.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ enum class BuiltinCommand(
3939
true,
4040
true
4141
),
42-
BROWSE("browse", "Fetch the content of a given URL.", AllIcons.Toolwindows.WebToolWindow, true, true),
42+
BROWSE("browse", "Fetch the content of a given URL.", AllIcons.Toolwindows.WebToolWindow, false, true),
4343
REFACTOR("refactor", "Refactor the content of a file, only support for rename, safeDelete and move.", AutoDevIcons.Idea, true, true),
4444
STRUCTURE(
4545
"structure",
@@ -60,18 +60,18 @@ enum class BuiltinCommand(
6060
"localSearch",
6161
"Search text in the scope (current only support project) will return 5 line before and after",
6262
AllIcons.Actions.Search,
63-
true,
63+
false,
6464
true
6565
),
6666
RELATED(
6767
"related",
6868
"Get related code by AST (abstract syntax tree) for the current file",
6969
AllIcons.Actions.Find,
70-
true,
70+
false,
7171
true
7272
),
73-
OPEN("open", "Open a file in the editor", AllIcons.Actions.MenuOpen, false),
74-
RIPGREP_SEARCH("ripgrepSearch", "Search text in the project with ripgrep", AllIcons.Actions.Regex, true, true),
73+
OPEN("open", "Open a file in the editor", AllIcons.Actions.MenuOpen, false, true),
74+
RIPGREP_SEARCH("ripgrepSearch", "Search text in the project with ripgrep", AllIcons.Actions.Regex, false, true),
7575
;
7676

7777
companion object {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ class DevInsCompiler(
284284
BuiltinCommand.WRITE,
285285
BuiltinCommand.PATCH,
286286
BuiltinCommand.COMMIT,
287-
BuiltinCommand.DATABASE
287+
BuiltinCommand.DATABASE,
288+
BuiltinCommand.SHELL,
288289
)
289290

290291
if (hasReadCodeBlock) {

0 commit comments

Comments
 (0)