Skip to content

Commit

Permalink
Backup update
Browse files Browse the repository at this point in the history
  • Loading branch information
marvim committed Nov 12, 2024
1 parent e8635fa commit bd7c945
Show file tree
Hide file tree
Showing 176 changed files with 47,368 additions and 1,507 deletions.
2 changes: 1 addition & 1 deletion last_update
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-05T01:27:55Z
2024-11-12T02:20:36Z
246 changes: 207 additions & 39 deletions repositories/neovim/issues/12537.json

Large diffs are not rendered by default.

64 changes: 57 additions & 7 deletions repositories/neovim/issues/19624.json
Original file line number Diff line number Diff line change
Expand Up @@ -3381,9 +3381,54 @@
"url": "https://api.github.com/users/vurentjie",
"user_view_type": "public"
}
},
{
"author_association": "CONTRIBUTOR",
"body": "Hi,\n\nI would like to present my design for structured concurrency in Neovim: [Coop.nvim](https://github.com/gregorias/coop.nvim). I believe it addresses all requirements you have listed out for such a framework + it’s as straightforward as such a framework could be ([How it works doc](https://github.com/gregorias/coop.nvim/blob/main/How%20it%20works.md)). I believe it provides an elegant approach to the subject.\n\nHere’s how Coop relates to the listed requirements:\n\n> Representing a task.\n> Orchestrating \"pipelines\" (quasi monads?) of work (\"tasks\") and handling errors.\n\n[See examples](https://github.com/gregorias/coop.nvim/blob/0e2082500707f2a143ff924ad36577c348148517/lua/coop/examples.lua#L72) for examples of handling errors, running tasks in parallel, and complex awaiting conditions.\n\n> Maximally leveraging Lua coroutines + libuv. Only add concepts (\"task\", \"promise\") if absolutely needed.\n\nYes,\n\n- the Task interface is an extension to Lua coroutines and implements parallel `create, resume, yield, status` functions with equivalent semantics.\n- Libuv functions are easily ported through generic wrappers: https://github.com/gregorias/coop.nvim/blob/main/lua/coop/uv.lua.\n- Only two concepts are added: a task and a future.\n\n> Coroutines (or tasks that wrap coroutines) can be nested. ([ref](https://gregorias.github.io/posts/using-coroutines-in-neovim-lua/#addendum-whats-wrong-with-plenary-async))\n\nTrue. In Coop you can freely nest task functions (a task function is a function that may call `task.yield`).\n\n> Util to create an awaitable task from \"normal\" functions (cf. \"promisify\"?).\n> Example: vim.system() returns its own ad-hoc \"task\" that can be \"awaited\" via :wait().\n> Can e.g. vim.system() be \"promisified\" without its knowledge?\n\nCoop indeed “promisifies” `uv.spawn`. Coop’s implementation returns an awaitable future. [In tests you have an example of how it turns the callback interface from Neovim’s documentation into a synchronous one](https://github.com/gregorias/coop.nvim/blob/ff49c6d5a741e9e7b22366f5bedf43f7fcfd01c5/tests/coop/uv_spec.lua#L48-L84):\n\n```lua\nlocal stdin = vim.uv.new_pipe()\nlocal stdout = vim.uv.new_pipe()\nlocal stderr = vim.uv.new_pipe()\n\nlocal handle, pid, cat_future = uv.spawn(\"cat\", {\n\tstdio = { stdin, stdout, stderr },\n})\n\nlocal read_future = coop.Future.new()\nvim.uv.read_start(stdout, function(err, data)\n\tassert(not err, err)\n\tif data ~= nil and not read_future.done then\n\t\tread_future:complete(data)\n\tend\nend)\nvim.uv.write(stdin, \"Hello World\")\n\n-- Here we wrap the APIs into a task to use the synchronous looking interface.\nlocal task = coop.spawn(function()\n\t-- Wait for stdout to produce the data.\n\tlocal read_data = read_future:await()\n\tassert.are.same(\"Hello World\", read_data)\n\tlocal err_stdin_shutdown = uv.shutdown(stdin)\n\tassert.is.Nil(err_stdin_shutdown)\n\t-- Wait for the cat process to finish.\n\treturn cat_future:await()\nend)\n\n-- Wait for 200ms for the task finish.\nlocal exit_code, exit_sign = task:await(200, 2)\n```\n\n> Document (or generalize) [\"coroutine to callback\"](https://gregorias.github.io/posts/using-coroutines-in-neovim-lua/#coroutine-to-callback-conversion).\n\nCoop provides a generic converter callback to coroutine converter: `cb_to_tf` ([docs](https://github.com/gregorias/coop.nvim/blob/main/How%20it%20works.md#using-callbacks-to-build-coroutines).)\n\nThe generic conversion from a coroutine (a task) into a callback is done through [an await overload that accepts a callback](https://github.com/gregorias/coop.nvim/tree/main#:~:text=task.await(function(success%2C%20result)%20end)).\n\n> await_all, await_any (pseudo-names). See JS [Promise.all()](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise/all).\n> Results (and failures) can be aggregated. (Can't do this with jobwait()!)\n\nAll possible. For example, Coop provides an implementation of `as_completed`, an iterator that returns task results as they finish: [example](https://github.com/gregorias/coop.nvim/tree/main#:~:text=sort_with_time%20shows%20that%20Coop%20achieves%20true%20parallelism.%20It%20launches%20parallel%20timers%20with%20coop.spawn%20and%20uses%20a%20coop.control.as_completed%20to%20conveniently%20capture%20results%20as%20each%20timer%20completes.).\n\nTentative implementations of `await_all` and `await_any` are in [control.lua](https://github.com/gregorias/coop.nvim/blob/ff49c6d5a741e9e7b22366f5bedf43f7fcfd01c5/lua/coop/control.lua#L1-L68).\n\n> Tasks can be canceled.\n\n[True.](https://github.com/gregorias/coop.nvim/blob/main/How%20it%20works.md#cancellation)\n\n> Failures/errors can be handled\n\n[True.](https://github.com/gregorias/coop.nvim/blob/main/How%20it%20works.md#error-handling)\n\n> (possibly canceling the rest of the task tree).\n\nCoop doesn’t natively provide the task tree abstraction to keep with the Lua’s spirit of coroutines being standalone threads. Task trees can be implemented on top of Coop, because the programmer can intercept the `\"cancelled\"` error and `:cancel` subtasks.",
"created_at": "2024-11-10T11:40:03Z",
"html_url": "https://github.com/neovim/neovim/issues/19624#issuecomment-2466700118",
"id": 2466700118,
"issue_url": "https://api.github.com/repos/neovim/neovim/issues/19624",
"node_id": "IC_kwDOAPphoM6TBttW",
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 4,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 4,
"url": "https://api.github.com/repos/neovim/neovim/issues/comments/2466700118/reactions"
},
"updated_at": "2024-11-10T11:40:03Z",
"url": "https://api.github.com/repos/neovim/neovim/issues/comments/2466700118",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/722385?v=4",
"events_url": "https://api.github.com/users/gregorias/events{/privacy}",
"followers_url": "https://api.github.com/users/gregorias/followers",
"following_url": "https://api.github.com/users/gregorias/following{/other_user}",
"gists_url": "https://api.github.com/users/gregorias/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gregorias",
"id": 722385,
"login": "gregorias",
"node_id": "MDQ6VXNlcjcyMjM4NQ==",
"organizations_url": "https://api.github.com/users/gregorias/orgs",
"received_events_url": "https://api.github.com/users/gregorias/received_events",
"repos_url": "https://api.github.com/users/gregorias/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gregorias/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gregorias/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gregorias",
"user_view_type": "public"
}
}
],
"comments": 75,
"comments": 76,
"comments_url": "https://api.github.com/repos/neovim/neovim/issues/19624/comments",
"created_at": "2022-08-02T11:39:42Z",
"events_url": "https://api.github.com/repos/neovim/neovim/issues/19624/events",
Expand Down Expand Up @@ -3431,7 +3476,7 @@
"locked": false,
"milestone": {
"closed_at": null,
"closed_issues": 655,
"closed_issues": 660,
"created_at": "2014-05-10T20:43:04Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/1359421?v=4",
Expand Down Expand Up @@ -3461,10 +3506,10 @@
"labels_url": "https://api.github.com/repos/neovim/neovim/milestones/6/labels",
"node_id": "MDk6TWlsZXN0b25lNjU1MDM3",
"number": 6,
"open_issues": 607,
"open_issues": 614,
"state": "open",
"title": "backlog",
"updated_at": "2024-10-21T15:22:37Z",
"updated_at": "2024-11-07T08:21:30Z",
"url": "https://api.github.com/repos/neovim/neovim/milestones/6"
},
"node_id": "I_kwDOAPphoM5PBO-Z",
Expand All @@ -3476,18 +3521,23 @@
"confused": 0,
"eyes": 0,
"heart": 8,
"hooray": 20,
"hooray": 21,
"laugh": 0,
"rocket": 0,
"total_count": 29,
"total_count": 30,
"url": "https://api.github.com/repos/neovim/neovim/issues/19624/reactions"
},
"repository_url": "https://api.github.com/repos/neovim/neovim",
"state": "open",
"state_reason": null,
"sub_issues_summary": {
"completed": 0,
"percent_completed": 0,
"total": 0
},
"timeline_url": "https://api.github.com/repos/neovim/neovim/issues/19624/timeline",
"title": "Lua: structured concurrency, Promises, task pipelines",
"updated_at": "2024-10-21T16:45:33Z",
"updated_at": "2024-11-10T11:40:04Z",
"url": "https://api.github.com/repos/neovim/neovim/issues/19624",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/1359421?v=4",
Expand Down
62 changes: 47 additions & 15 deletions repositories/neovim/issues/20310.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,28 @@
"assignees": [],
"author_association": "MEMBER",
"body": "### Feature already in Vim?\n\n_No response_\n\n### Feature description\n\nWhen using `ext_messages`, I found no easy way to retrieve highlight attributes. `ext_hlstate` looks promising, but doesn't seem to be available within lua.\r\n\r\nWould be great if there would be an API call to retrieve the HL attributes.\r\n\r\nCurrent workaround I found by @notomo:\r\n\r\n```lua\r\nlocal M = {}\r\n\r\nfunction M.setup()\r\n local ffi = require(\"ffi\")\r\n local ok, err = pcall(\r\n ffi.cdef,\r\n [[typedef int32_t RgbValue;\r\n typedef struct attr_entry {\r\n int16_t rgb_ae_attr, cterm_ae_attr;\r\n RgbValue rgb_fg_color, rgb_bg_color, rgb_sp_color;\r\n int cterm_fg_color, cterm_bg_color;\r\n int hl_blend;\r\n } HlAttrs;\r\n HlAttrs syn_attr2entry(int attr);]]\r\n )\r\n if not ok and not err:find(\"redefine\") then\r\n error(err)\r\n end\r\n M.attr2entry = ffi.C.syn_attr2entry\r\nend\r\n\r\nfunction M.attr2entry(attr_id)\r\n M.setup()\r\n return M.attr2entry(attr_id)\r\nend\r\n\r\nM.cache = {}\r\n\r\nfunction M.get_hl_group(attr_id)\r\n return \"NoiceAttr\" .. tostring(attr_id)\r\nend\r\n\r\nfunction M.get_hl(attr_id)\r\n if not M.cache[attr_id] then\r\n local attrs = M.attr2entry(attr_id)\r\n local hl_group = M.get_hl_group(attr_id)\r\n vim.api.nvim_set_hl(0, hl_group, {\r\n fg = attrs.rgb_fg_color,\r\n bg = attrs.rgb_bg_color,\r\n sp = attrs.rgb_sp_color,\r\n bold = bit.band(attrs.rgb_ae_attr, 0x02),\r\n standout = bit.band(attrs.rgb_ae_attr, 0x0100),\r\n italic = bit.band(attrs.rgb_ae_attr, 0x04),\r\n underline = bit.band(attrs.rgb_ae_attr, 0x08),\r\n undercurl = bit.band(attrs.rgb_ae_attr, 0x10),\r\n nocombine = bit.band(attrs.rgb_ae_attr, 0x0200),\r\n reverse = bit.band(attrs.rgb_ae_attr, 0x01),\r\n blend = attrs.hl_blend ~= -1 and attrs.hl_blend or nil,\r\n })\r\n M.cache[attr_id] = hl_group\r\n end\r\n return M.cache[attr_id]\r\nend\r\n\r\nreturn M\r\n```",
"closed_at": null,
"closed_at": "2024-11-11T11:26:36Z",
"closed_by": {
"avatar_url": "https://avatars.githubusercontent.com/u/1363104?v=4",
"events_url": "https://api.github.com/users/bfredl/events{/privacy}",
"followers_url": "https://api.github.com/users/bfredl/followers",
"following_url": "https://api.github.com/users/bfredl/following{/other_user}",
"gists_url": "https://api.github.com/users/bfredl/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bfredl",
"id": 1363104,
"login": "bfredl",
"node_id": "MDQ6VXNlcjEzNjMxMDQ=",
"organizations_url": "https://api.github.com/users/bfredl/orgs",
"received_events_url": "https://api.github.com/users/bfredl/received_events",
"repos_url": "https://api.github.com/users/bfredl/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bfredl/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bfredl/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bfredl",
"user_view_type": "public"
},
"comment_data": [
{
"author_association": "NONE",
Expand Down Expand Up @@ -47,7 +68,8 @@
"starred_url": "https://api.github.com/users/sassanh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sassanh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sassanh"
"url": "https://api.github.com/users/sassanh",
"user_view_type": "public"
}
},
{
Expand Down Expand Up @@ -91,7 +113,8 @@
"starred_url": "https://api.github.com/users/dsully/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dsully/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dsully"
"url": "https://api.github.com/users/dsully",
"user_view_type": "public"
}
},
{
Expand Down Expand Up @@ -135,7 +158,8 @@
"starred_url": "https://api.github.com/users/clason/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/clason/subscriptions",
"type": "User",
"url": "https://api.github.com/users/clason"
"url": "https://api.github.com/users/clason",
"user_view_type": "public"
}
},
{
Expand Down Expand Up @@ -179,7 +203,8 @@
"starred_url": "https://api.github.com/users/vhakulinen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vhakulinen/subscriptions",
"type": "User",
"url": "https://api.github.com/users/vhakulinen"
"url": "https://api.github.com/users/vhakulinen",
"user_view_type": "public"
}
}
],
Expand Down Expand Up @@ -220,7 +245,7 @@
{
"color": "c5def5",
"default": false,
"description": "UI extensibility, events, protocol",
"description": "UI extensibility, events, protocol, externalized UI",
"id": 640132777,
"name": "ui-extensibility",
"node_id": "MDU6TGFiZWw2NDAxMzI3Nzc=",
Expand All @@ -231,7 +256,7 @@
"locked": false,
"milestone": {
"closed_at": null,
"closed_issues": 35,
"closed_issues": 94,
"created_at": "2023-12-07T23:09:35Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/1359421?v=4",
Expand All @@ -251,19 +276,20 @@
"starred_url": "https://api.github.com/users/justinmk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/justinmk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/justinmk"
"url": "https://api.github.com/users/justinmk",
"user_view_type": "public"
},
"description": "",
"due_on": "2024-10-31T07:00:00Z",
"due_on": "2024-12-25T08:00:00Z",
"html_url": "https://github.com/neovim/neovim/milestone/41",
"id": 10283236,
"labels_url": "https://api.github.com/repos/neovim/neovim/milestones/41/labels",
"node_id": "MI_kwDOAPphoM4AnOjk",
"number": 41,
"open_issues": 50,
"open_issues": 53,
"state": "open",
"title": "0.11",
"updated_at": "2024-06-24T03:19:54Z",
"updated_at": "2024-11-11T14:23:28Z",
"url": "https://api.github.com/repos/neovim/neovim/milestones/41"
},
"node_id": "I_kwDOAPphoM5ShAXG",
Expand All @@ -282,11 +308,16 @@
"url": "https://api.github.com/repos/neovim/neovim/issues/20310/reactions"
},
"repository_url": "https://api.github.com/repos/neovim/neovim",
"state": "open",
"state_reason": null,
"state": "closed",
"state_reason": "completed",
"sub_issues_summary": {
"completed": 0,
"percent_completed": 0,
"total": 0
},
"timeline_url": "https://api.github.com/repos/neovim/neovim/issues/20310/timeline",
"title": "vim.ui_attach: make it easier to retrieve highlight attributes (with `ext_messages`)",
"updated_at": "2024-06-18T22:55:23Z",
"updated_at": "2024-11-11T11:26:36Z",
"url": "https://api.github.com/repos/neovim/neovim/issues/20310",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/292349?v=4",
Expand All @@ -306,6 +337,7 @@
"starred_url": "https://api.github.com/users/folke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/folke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/folke"
"url": "https://api.github.com/users/folke",
"user_view_type": "public"
}
}
Loading

0 comments on commit bd7c945

Please sign in to comment.