Skip to content

fix: type hints on Job:new #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lua/plenary/job.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local vim = vim
local uv = vim.loop
local uv = vim.uv or vim.loop
local compat = require "plenary.compat"

local F = require "plenary.functional"

---@class Job
---@class JobOptions
---@field command string Command to run
---@field args? string[] List of arguments to pass
---@field cwd? string Working directory for job
Expand All @@ -20,6 +20,8 @@ local F = require "plenary.functional"
---@field on_exit? fun(self: Job, code: number, signal: number)
---@field maximum_results? number Stop processing results after this number
---@field writer? Job|table|string Job that writes to stdin of this job.

---@class Job: JobOptions
local Job = {}
Job.__index = Job

Expand Down Expand Up @@ -78,7 +80,7 @@ end
--- Map-like table

---Create a new job
---@param o Job
---@param o JobOptions | string[]
---@return Job
function Job:new(o)
if not o then
Expand Down