Add permanence refs opens picker, labels inject into INHERITS
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -94,15 +94,19 @@ function extractState(locks: string) {
|
||||
return String(match?.[1] || '').replace(/\s+/g, ' ').trim()
|
||||
}
|
||||
|
||||
export function permanenceLabels(refs: PermanenceRef[] | null | undefined) {
|
||||
return [...new Set(normalizePermanenceRefs(refs).map(item => item.label).filter(Boolean))]
|
||||
}
|
||||
|
||||
function permanenceLine(refs: PermanenceRef[]) {
|
||||
const labels = [...new Set(refs.map(item => item.label).filter(Boolean))]
|
||||
const labels = permanenceLabels(refs)
|
||||
if (!labels.length) return ''
|
||||
return `Permanence: ${labels.join(', ')} stay the same.`
|
||||
}
|
||||
|
||||
function inheritLine(locks: string, refs: PermanenceRef[]) {
|
||||
const parts = ['[INHERITS] Global locks.']
|
||||
const labels = [...new Set(refs.map(item => item.label).filter(Boolean))]
|
||||
const labels = permanenceLabels(refs)
|
||||
if (labels.length) parts.push(`Same ${labels.join(', ')} as locked.`)
|
||||
const state = extractState(locks)
|
||||
if (state) parts.push(`State: ${state}`)
|
||||
|
||||
Reference in New Issue
Block a user