Editor IntelliSense¶
The site editor knows your project: tables, fields, partials, assets, layouts, translations and Methods. It uses them to suggest code, document it on hover and flag mistakes before you preview the page.
Suggestions appear as you type; press Ctrl + Space to open them at any time.
Always up to date¶
IntelliSense data is refreshed live. When you — or a teammate — add a field to a table, create a partial or save a Method, the editor suggests it immediately, without reloading the page.
In templates (Handlebars)¶
| You type | The editor suggests |
|---|---|
{{#each ekdata. / {{#single ekdata. |
the project's tables — picking one also declares the datasource in the front matter if needed |
{{this. inside a block |
the fields of the datasource's table |
{{ekasset ' |
the site's assets |
{{> |
the site's partials |
{{ektrans ' |
the translation keys |
In the YAML front matter¶
The front matter — the YAML block between the two --- lines at the top of a .hbs file — is fully assisted. The same assistance applies to .yaml files.
Suggestions follow the indentation of the line you are typing, so they keep working while the YAML is still incomplete.
Keys¶
At each level, the editor suggests the keys that make sense there, with their documentation:
- root:
layout,datasources,metas,cache(page cache); - a table datasource:
type,from,limit,page,sort,filter,uid,slug,cursor,when; - a Method datasource:
type,method,inputs,when; sort:field,dir—filter:field,value,op;metas:title,description,canonical,robots,og,twitter,alternates;cache:ttlSeconds.
Under datasources:, ready-to-use snippets create a table or a Method datasource, or a datasource named after one of your tables.
Values¶
| Key | Suggestions |
|---|---|
layout |
the files of layouts/ |
from |
the project's tables |
sort.field, filter.field |
the fields of the table in from of this datasource |
sort.dir |
asc, desc |
method |
the site's enabled Methods, with their description and inputs |
inputs |
the inputs of the selected Method: type, required, default value, description |
og.type, twitter.card, robots |
the allowed values |
Template variables¶
Inside a '{{…' string, the editor suggests the variables available where you are:
| Section | Variables |
|---|---|
datasources |
query.…, params.slug, params.view, params.lang, i18n.… |
metas |
lang, query.…, params.slug, params.view, record.…, i18n.… |
Note
{{lang}} is not available inside datasources: use {{params.lang}}.
Hover documentation¶
Hover a key to read its documentation; hover a value to see the table (label, description, number of fields), the field (label, type) or the Method (description, exposure, inputs).
In JavaScript files¶
In the site's .js files, the global ekit object is typed from your project:
| You type | The editor suggests |
|---|---|
ekit.data. |
the datasources exposed with expose: true in the site's views, partials and layouts |
ekit.data.items[0]. |
the fields of the datasource's table, with their label and type |
ekit.methods.call(' |
the site's public and enabled Methods |
ekit.methods.call('slug', { |
the inputs of that Method — type, required, description — with signature help |
Hover a property to see where it comes from (table, Method, file). Add // @ts-check at the top of a file to have type errors underlined.
Note
Assistance applies to .js files, not to inline <script> blocks inside .hbs templates.
Diagnostics¶
The editor checks the front matter and the template itself shortly after you stop typing (and as soon as a file is opened), and underlines problems:
| Severity | Examples |
|---|---|
| Error | invalid YAML (at the exact line), unclosed front matter, unknown table, datasource without from or method, unknown Method, missing required input; in the template: syntax error (a block that is not closed…), unknown helper, missing partial |
| Warning | unknown key, unknown field in sort / filter, dir other than asc / desc, limit above 200, uid and slug together, disabled Method, unknown input, input of the wrong type, unknown layout, datasource declared but never used (neither in the page nor in its partials) |
| Info | ekdata.X used but not declared in this file, page / cursor keys (not used by the engine — see Pagination) |
Press F8 to jump from one problem to the next.
Values computed at render time — any value containing {{…}} — are not checked, since they depend on the request:
sort:
field: "{{ternary (eq query.type 'acteurs') 'nom' 'titre'}}"
dir: "{{ternary (eq query.s 'desc') 'desc' 'asc'}}"
Problems panel¶
The Problems icon of the activity bar (warning sign) lists the errors and warnings of all the templates of the site — views, partials and layouts, including the files that are not open — grouped by file. A counter on the icon shows the number of errors (or of warnings when there is no error). Click a problem to open the file at its line. The list is updated after each save and after each AI generation; Check again updates it at any time.
Info diagnostics
A layout, a view and its partials share their datasources. An ekdata.X declared in another file is therefore reported as information only, not as an error.