feat(editor): complete the apis block and drop the removed snippets

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 12:31:23 +05:30
co-authored by Claude Opus 5
parent 990a8128a7
commit 2bb52487eb
5 changed files with 62 additions and 6 deletions
+48
View File
@@ -306,6 +306,54 @@ const BLOCK_COMPLETIONS = [
"}",
].join("\n"),
},
{
label: "apis",
detail: "Page-level API call declarations block",
documentation:
"Declare the API calls available to this page as named entries, each callable via api.<name>() from functions and the `api=` view binding.",
snippet: [
"apis {",
" ${1:searchUsers} ${2|GET,POST,PUT,PATCH,DELETE|} ${3:/api/users} {",
" request {",
" body {",
" ${4:name}?: ${5:string}",
" }",
" }",
"",
" response {",
" return ${6:data}",
" }",
"",
" error {",
" return ${7:null}",
" }",
" }",
"}",
].join("\n"),
},
{
label: "apis entry",
detail: "Single API call declaration",
documentation:
"Declare a single named API call inside an apis { } block: <name> <METHOD> <path> { request/response/error }.",
snippet: [
"${1:searchUsers} ${2|GET,POST,PUT,PATCH,DELETE|} ${3:/api/users} {",
" request {",
" body {",
" ${4:name}?: ${5:string}",
" }",
" }",
"",
" response {",
" return ${6:data}",
" }",
"",
" error {",
" return ${7:null}",
" }",
"}",
].join("\n"),
},
{
label: "persist",
detail: "Include-only store persistence",