Skip to content

Commit

Permalink
refactor(devins-lang): add support for browsing web content with new …
Browse files Browse the repository at this point in the history
…command `/browse`

This commit introduces a new feature to the `devins-lang` extension, allowing users to browse web content using the new `/browse` command. The command is implemented in `BrowseInsCommand.kt`, which now includes a `runInEdt` block to ensure thread safety when parsing and retrieving the body of the web content.
  • Loading branch information
phodal committed Mar 28, 2024
1 parent 0680ff5 commit 490f97d
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ package cc.unitmesh.devti.language.compiler

import cc.unitmesh.devti.language.agenttool.browse.BrowseTool
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 {
override suspend fun execute(): String? {
val documentContent = BrowseTool.parse(prop)
return documentContent.body
var body: String? = null
runInEdt {
val parse = BrowseTool.parse(prop)
body = parse.body
}

return body
}
}

0 comments on commit 490f97d

Please sign in to comment.