Skip to content

Commit

Permalink
docs(devins-lang): add support for browsing web content with new comm…
Browse files Browse the repository at this point in the history
…and `/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`.
  • Loading branch information
phodal committed Mar 28, 2024
1 parent 490f97d commit 959706a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/devins/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ScreenShot
- `/symbol`: get child by symbol, like get Class by package name, format: `java.lang.String#length`,
example: `<package>.<class>#<method>`
- `/shell`: run shell command, like `ls`, `pwd`, etc.
- '/browse': browse web page, like `https://ide.unitmesh.cc`

### File Command

Expand Down Expand Up @@ -98,3 +99,10 @@ The output will be:
}
```

### Browse Command

Browse web page:

/browse:https://ide.unitmesh.cc

The will be text inside body from web page.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cc.unitmesh.devti.language.compiler.exec.InsCommand
import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.project.Project

class BrowseInsCommand(val myProject: Project, val prop: String) : InsCommand {
class BrowseInsCommand(val myProject: Project, private val prop: String) : InsCommand {
override suspend fun execute(): String? {
var body: String? = null
runInEdt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ enum class BuiltinCommand(
true,
true
),
BROWSE("browse", "Get the content of a given URL.", AllIcons.Xml.Browsers.Firefox, false, true),
BROWSE(
"browse",
"Get the content of a given URL",
AllIcons.Toolwindows.WebToolWindow,
false,
true
),
;

companion object {
Expand Down

0 comments on commit 959706a

Please sign in to comment.