Skip to content

Commit

Permalink
Improve lua-language-server annotations of Job class
Browse files Browse the repository at this point in the history
  • Loading branch information
tvercruyssen committed Sep 11, 2023
1 parent 0232372 commit 24a03b1
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions lua/plenary/job.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ local uv = vim.loop
local F = require "plenary.functional"

---@class Job
---@field command string : Command to run
---@field args Array : List of arguments to pass
---@field cwd string : Working directory for job
---@field env Map|Array : Environment looking like: { ['VAR'] = 'VALUE } or { 'VAR=VALUE' }
---@field skip_validation boolean : Skip validating the arguments
---@field enable_handlers boolean : If set to false, disables all callbacks associated with output
---@field on_start function : Run when starting job
---@field on_stdout function : (error: string, data: string, self? Job)
---@field on_stderr function : (error: string, data: string, self? Job)
---@field on_exit function : (self, 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.
---@field detached boolean : Spawn the child in a detached state making it a process group leader
---@field enabled_recording boolean
---@field command string Command to run
---@field args? string[] List of arguments to pass
---@field cwd? string Working directory for job
---@field env? table<string, string>|string[] Environment looking like: { ['VAR'] = 'VALUE' } or { 'VAR=VALUE' }
---@field interactive? boolean
---@field detached? boolean Spawn the child in a detached state making it a process group leader
---@field skip_validation? boolean Skip validating the arguments
---@field enable_handlers? boolean If set to false, disables all callbacks associated with output (default: true)
---@field enabled_recording? boolean
---@field on_start? fun()
---@field on_stdout? fun(error: string, data: string, self?: Job)
---@field on_stderr? fun(error: string, data: string, self?: Job)
---@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.
local Job = {}
Job.__index = Job

Expand Down

0 comments on commit 24a03b1

Please sign in to comment.