Skip to content

Commit 959706a

Browse files
committed
docs(devins-lang): add support for browsing web content with new command /browse
This commit introduces a new command `/browse` to the Devins language, allowing users to browse web content within the language environment. The command is implemented in `BrowseInsCommand.kt` and is documented in `docs/devins/quick-start.md`.
1 parent 490f97d commit 959706a

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

docs/devins/quick-start.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ScreenShot
3333
- `/symbol`: get child by symbol, like get Class by package name, format: `java.lang.String#length`,
3434
example: `<package>.<class>#<method>`
3535
- `/shell`: run shell command, like `ls`, `pwd`, etc.
36+
- '/browse': browse web page, like `https://ide.unitmesh.cc`
3637

3738
### File Command
3839

@@ -98,3 +99,10 @@ The output will be:
9899
}
99100
```
100101

102+
### Browse Command
103+
104+
Browse web page:
105+
106+
/browse:https://ide.unitmesh.cc
107+
108+
The will be text inside body from web page.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import cc.unitmesh.devti.language.compiler.exec.InsCommand
55
import com.intellij.openapi.application.runInEdt
66
import com.intellij.openapi.project.Project
77

8-
class BrowseInsCommand(val myProject: Project, val prop: String) : InsCommand {
8+
class BrowseInsCommand(val myProject: Project, private val prop: String) : InsCommand {
99
override suspend fun execute(): String? {
1010
var body: String? = null
1111
runInEdt {

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ enum class BuiltinCommand(
4040
true,
4141
true
4242
),
43-
BROWSE("browse", "Get the content of a given URL.", AllIcons.Xml.Browsers.Firefox, false, true),
43+
BROWSE(
44+
"browse",
45+
"Get the content of a given URL",
46+
AllIcons.Toolwindows.WebToolWindow,
47+
false,
48+
true
49+
),
4450
;
4551

4652
companion object {

0 commit comments

Comments
 (0)