mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-26 07:44:56 +00:00
feat(app): add skill slash commands (#11369)
This commit is contained in:
@@ -359,6 +359,20 @@ export function Autocomplete(props: {
|
||||
})
|
||||
}
|
||||
|
||||
for (const skill of sync.data.skill) {
|
||||
results.push({
|
||||
display: "/skill:" + skill.name,
|
||||
description: skill.description,
|
||||
onSelect: () => {
|
||||
const newText = `Load the "${skill.name}" skill and follow its instructions.`
|
||||
const cursor = props.input().logicalCursor
|
||||
props.input().deleteRange(0, 0, cursor.row, cursor.col)
|
||||
props.input().insertText(newText)
|
||||
props.input().cursorOffset = Bun.stringWidth(newText)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
results.sort((a, b) => a.display.localeCompare(b.display))
|
||||
|
||||
const max = firstBy(results, [(x) => x.display.length, "desc"])?.display.length
|
||||
|
||||
Reference in New Issue
Block a user