Type hbsCompletions
This commit is contained in:
parent
a84044e6a1
commit
576e14a23a
|
@ -1,10 +1,10 @@
|
||||||
import { getManifest, helpersToRemoveForJs } from "@budibase/string-templates"
|
import { getManifest, helpersToRemoveForJs } from "@budibase/string-templates"
|
||||||
|
import { Helper } from "@budibase/types"
|
||||||
|
|
||||||
export function handlebarsCompletions() {
|
export function handlebarsCompletions(): Helper[] {
|
||||||
const manifest = getManifest()
|
const manifest = getManifest()
|
||||||
|
return Object.values(manifest).flatMap(helpersObj =>
|
||||||
return Object.keys(manifest).flatMap(key =>
|
Object.entries(helpersObj).map<Helper>(([helperName, helperConfig]) => ({
|
||||||
Object.entries(manifest[key]).map(([helperName, helperConfig]) => ({
|
|
||||||
text: helperName,
|
text: helperName,
|
||||||
path: helperName,
|
path: helperName,
|
||||||
example: helperConfig.example,
|
example: helperConfig.example,
|
||||||
|
@ -14,6 +14,7 @@ export function handlebarsCompletions() {
|
||||||
allowsJs:
|
allowsJs:
|
||||||
!helperConfig.requiresBlock &&
|
!helperConfig.requiresBlock &&
|
||||||
!helpersToRemoveForJs.includes(helperName),
|
!helpersToRemoveForJs.includes(helperName),
|
||||||
|
args: helperConfig.args,
|
||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
Reference in New Issue