Skip to content

Commit

Permalink
docs(readme): fix hook example with full file content
Browse files Browse the repository at this point in the history
  • Loading branch information
frankroeder committed Sep 16, 2024
1 parent 0db1e3b commit d34b637
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,25 +464,25 @@ receives the full file context and the selected code snippet as input.
require("parrot").setup {
-- ...
hooks = {
CompleteFullContext = function(prt, params)
local template = [[
I have the following code from {{filename}}:
CompleteFullContext = function(prt, params)
local template = [[
I have the following code from {{filename}}:
```{{filetype}}
{{filecontent}}
```
```{{filetype}}
{filecontent}}
```
Please look at the following section specifically:
```{{filetype}}
{{selection}}
```
Please look at the following section specifically:
```{{filetype}}
{{selection}}
```
Please finish the code above carefully and logically.
Respond just with the snippet of code that should be inserted.
]]
local model_obj = prt.get_model()
prt.Prompt(params, prt.ui.Target.append, model_obj, nil, template)
end,
Please finish the code above carefully and logically.
Respond just with the snippet of code that should be inserted.
]]
local model_obj = prt.get_model("command")
prt.Prompt(params, prt.ui.Target.append, model_obj, nil, template)
end,
}
-- ...
}
Expand Down

0 comments on commit d34b637

Please sign in to comment.