budibase/packages/builder/src/constants/completions.js

17 lines
455 B
JavaScript
Raw Normal View History

2021-02-01 12:51:53 +01:00
import { getManifest } from "@budibase/string-templates"
export function handlebarsCompletions() {
const manifest = getManifest()
2021-05-03 09:31:09 +02:00
return Object.keys(manifest).flatMap((key) =>
2021-02-01 12:51:53 +01:00
Object.entries(manifest[key]).map(([helperName, helperConfig]) => ({
text: helperName,
path: helperName,
2021-02-02 18:43:01 +01:00
example: helperConfig.example,
2021-02-01 15:29:51 +01:00
label: helperName,
2021-02-01 12:51:53 +01:00
displayText: helperName,
description: helperConfig.description,
}))
)
}