aboutsummaryrefslogtreecommitdiffstats
path: root/doc/reference.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/reference.md')
-rw-r--r--doc/reference.md20
1 files changed, 10 insertions, 10 deletions
diff --git a/doc/reference.md b/doc/reference.md
index c16f2e0e..245cde7a 100644
--- a/doc/reference.md
+++ b/doc/reference.md
@@ -99,10 +99,10 @@ Metatable used to declare language identifiers. Any key is valid and will be aut
example:
```lua
- print(vim.inspect(Package.Lang)) -- prints {}
- local lang = Package.Lang.SomeMadeUpLanguage
- print(lang) -- prints "SomeMadeUpLanguage"
- print(vim.inspect(Package.Lang)) -- prints { SomeMadeUpLanguage = "SomeMadeUpLanguage" }
+print(vim.inspect(Package.Lang)) -- prints {}
+local lang = Package.Lang.SomeMadeUpLanguage
+print(lang) -- prints "SomeMadeUpLanguage"
+print(vim.inspect(Package.Lang)) -- prints { SomeMadeUpLanguage = "SomeMadeUpLanguage" }
```
### `Package.Cat`
@@ -110,7 +110,7 @@ example:
**Type:**
```lua
-{
+Package.Cat = {
Compiler = "Compiler",
Runtime = "Runtime",
DAP = "DAP",
@@ -228,10 +228,10 @@ Pkg.new {
--- ...
---@async
---@param ctx InstallContext
- install = function (ctx)
+ install = function(ctx)
ctx.stdio_sink.stdout "I am doing stuff\n"
ctx.stdio_sink.stderr "Something went wrong!\n"
- end
+ end,
}
```
@@ -255,13 +255,13 @@ Pkg.new {
--- ...
---@async
---@param ctx InstallContext
- install = function (ctx)
+ install = function(ctx)
ctx.spawn.npm { "install", "some-package" }
-- Calls to spawn will raise an error if it exits with a non-OK exit code or signal.
- pcall(function ()
+ pcall(function()
ctx.spawn.commandoesntexist {}
end)
- end
+ end,
}
```