Add definitions to editor docs

This commit is contained in:
Igor Támara 2025-11-06 15:12:48 -05:00 committed by CJ van den Berg
parent 0cf7a4ead5
commit 1bb3b70864
2 changed files with 167 additions and 113 deletions

View file

@ -113,13 +113,12 @@ pub const goto_line_meta: Meta = .{ .arguments = &.{.integer} };
and to actually receiving the integer parameter, `goto_line` will
extract from the context like this:
>[]($block.attrs('line-numbers-js'))
>```zig
>pub fn goto_line(self: *Self, ctx: Context) Result {
> var line: usize = 0;
> if (!try ctx.args.match(.{tp.extract(&line)}))
> return error.InvalidGotoLineArgument;
>```
```zig
pub fn goto_line(self: *Self, ctx: Context) Result {
var line: usize = 0;
if (!try ctx.args.match(.{tp.extract(&line)}))
return error.InvalidGotoLineArgument;
```
To send a parameter to a command, make sure that the type is exactly
the same when retrieving it. We will refer as encode and decode when