We use velocity template to generate code. Here is a simple example:
/file: read file content, format: /file:<file-path>, example: /file:src/main/java/com/example/Controller.java./write: write file content, format: file#L1-L12, example: src/main/java/com/example/Controller.java#L1-L12/rev: read git change by git revision./run: run code, especially for test file, which is the best way to run code./patch: apply patches to file./commit: commit changes to git/symbol: get child by symbol, like get Class by package name, format: java.lang.String#length,
example: <package>.<class>#<method>/shell: run shell command or shell script, like ls, pwd, etc./browse: browse web page, like https://ide.unitmesh.cc/refactor: refactor code, like rename, delete, move etc.we keep "/" as File.separator for macOS, Windows and Unix.
Read file content:
will call LLM to handle it.
write content to file:
Read git change by git revision:
will call LLM to handle it.
Run file:
PS: current only support for TestFile, since UnitTest is the best way to run code.
Get child elements by symbol, like get Class by package name.
The output will be:
Get method will return code:
The output will be:
Browse web page:
It will be text inside the body from web page.
Refactor code:
It will be handled in local.