feat(suggestions): add tags around json (#1441)
This commit is contained in:
@@ -110,6 +110,7 @@ L5: pass
|
||||
{
|
||||
role = "assistant",
|
||||
content = [[
|
||||
<suggestions>
|
||||
[
|
||||
[
|
||||
{
|
||||
@@ -136,6 +137,7 @@ L5: pass
|
||||
},
|
||||
]
|
||||
]
|
||||
</suggestions>
|
||||
]],
|
||||
},
|
||||
}
|
||||
@@ -165,6 +167,7 @@ L5: pass
|
||||
if cursor_row ~= doc.position.row or cursor_col ~= doc.position.col then return end
|
||||
-- Clean up markdown code blocks
|
||||
full_response = Utils.trim_think_content(full_response)
|
||||
full_response = full_response:gsub("<suggestions>\n(.-)\n</suggestions>", "%1")
|
||||
full_response = full_response:gsub("^```%w*\n(.-)\n```$", "%1")
|
||||
full_response = full_response:gsub("(.-)\n```\n?$", "%1")
|
||||
-- Remove everything before the first '[' to ensure we get just the JSON array
|
||||
|
||||
Reference in New Issue
Block a user