Skip to content

Conversation

dbluhm
Copy link

@dbluhm dbluhm commented May 17, 2025

When using plenary.job with LuaLS running, using Job:new resulted in an error saying that there were missing required fields:
image

These fields are the defined methods on Job. Since Job:new was annotated as accepting as param o a value of type Job, LuaLS is expecting o to have all of the fields of Job. This obviously isn't how Job:new is intended to be used.

This PR adds a separate type definition for a JobOptions, containing all of the field annotations originally on Job. It also makes the Job class definition inherit these fields. It then makes Job:new accept a JobOptions instead of Job for param o. This also adds string[] as an acceptable type for o to support that usage pattern.

There is one other unrelated change (happy to drop if it's not agreeable): setting uv to vim.uv or vim.loop, since vim.loop will be deprecated. This change also resolved several diagnostics raised by LuaLS/LazyDev in this module.

Thanks!

@dbluhm
Copy link
Author

dbluhm commented Jun 13, 2025

Friendly nudge @Conni2461. This should be a pretty straightforward change with no difference in behavior at runtime, just QOL improvement for type checking.

@dbluhm
Copy link
Author

dbluhm commented Sep 26, 2025

There doesn't seem to be any interest in merging this so I'm going to close

@dbluhm dbluhm closed this Sep 26, 2025
@Ian2020
Copy link

Ian2020 commented Sep 29, 2025

Shame, was hoping this would get accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants