aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2024-05-11 23:21:55 +0200
committerGitHub <noreply@github.com>2024-05-11 21:21:55 +0000
commite91ff44c0a97a76a004b5516db8e3085d1955fb6 (patch)
tree60d80b873fb6aba79c6761831b4fa0d914cff588
parentfix: fix usage of deprecated Neovim APIs (#1703) (diff)
downloadmason-e91ff44c0a97a76a004b5516db8e3085d1955fb6.tar
mason-e91ff44c0a97a76a004b5516db8e3085d1955fb6.tar.gz
mason-e91ff44c0a97a76a004b5516db8e3085d1955fb6.tar.bz2
mason-e91ff44c0a97a76a004b5516db8e3085d1955fb6.tar.lz
mason-e91ff44c0a97a76a004b5516db8e3085d1955fb6.tar.xz
mason-e91ff44c0a97a76a004b5516db8e3085d1955fb6.tar.zst
mason-e91ff44c0a97a76a004b5516db8e3085d1955fb6.zip
chore(registry): clean up recent changes (#1704)
-rw-r--r--lua/mason-registry/sources/file.lua32
1 files changed, 14 insertions, 18 deletions
diff --git a/lua/mason-registry/sources/file.lua b/lua/mason-registry/sources/file.lua
index 2da7d7bc..d21c1f9f 100644
--- a/lua/mason-registry/sources/file.lua
+++ b/lua/mason-registry/sources/file.lua
@@ -91,24 +91,21 @@ function FileRegistrySource:install()
---@type ReaddirEntry[]
local entries = _.filter(_.prop_eq("type", "directory"), fs.async.readdir(packages_dir))
- local streaming_parser
- do
- streaming_parser = coroutine.wrap(function()
- local buffer = ""
- while true do
- local delim = buffer:find("\n", 1, true)
- if delim then
- local content = buffer:sub(1, delim - 1)
- buffer = buffer:sub(delim + 1)
- local chunk = coroutine.yield(content)
- buffer = buffer .. chunk
- else
- local chunk = coroutine.yield()
- buffer = buffer .. chunk
- end
+ local streaming_parser = coroutine.wrap(function()
+ local buffer = ""
+ while true do
+ local delim = buffer:find("\n", 1, true)
+ if delim then
+ local content = buffer:sub(1, delim - 1)
+ buffer = buffer:sub(delim + 1)
+ local chunk = coroutine.yield(content)
+ buffer = buffer .. chunk
+ else
+ local chunk = coroutine.yield()
+ buffer = buffer .. chunk
end
- end)
- end
+ end
+ end)
-- Initialize parser coroutine.
streaming_parser()
@@ -128,7 +125,6 @@ function FileRegistrySource:install()
end
end
- a.scheduler()
try(spawn
[yq]({
"-I0", -- output one document per line