From 82a797cbbed8f7f02197d8d022d265353a210c73 Mon Sep 17 00:00:00 2001 From: Thibeau Vercruyssen <74682871+tvercruyssen@users.noreply.github.com> Date: Tue, 12 Sep 2023 10:54:48 +0200 Subject: [PATCH] docs: Improve `lua-language-server` annotations of `Job` class (#526) --- lua/plenary/job.lua | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/lua/plenary/job.lua b/lua/plenary/job.lua index 2d61fd34..7dc31c38 100644 --- a/lua/plenary/job.lua +++ b/lua/plenary/job.lua @@ -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[] 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