Skip to content

fix(types): make partial configs portable - #2649

Open
oriori1703 wants to merge 1 commit into
saghen:mainfrom
oriori1703:fix/portable-partial-types
Open

oriori1703 wants to merge 1 commit into
saghen:mainfrom
oriori1703:fix/portable-partial-types

Conversation

@oriori1703

Copy link
Copy Markdown

Summary

  • replace LuaLS-specific empty-table partial inheritance with explicit optional field overrides
  • preserve strict internal configuration types and nested partial types
  • make partial configuration annotations work in both LuaLS and EmmyLua

Verification

  • every inherited strict field is represented in its partial class
  • user configuration passes EmmyLua 0.25.1 and LuaLS 3.19.1 without missing-field diagnostics
  • invalid partial values are still rejected by both analyzers
  • strict configurations still report missing fields
  • StyLua and git diff --check pass

Closes #2648

@saghen

saghen commented Oct 4, 2026

Copy link
Copy Markdown
Owner

This type of operation is quite common in the neovim plugin space. I'd prefer that the new LSP support it, rather than having every plugin provide duplicated types that may drift out of sync.

@oriori1703

Copy link
Copy Markdown
Author

This type of operation is quite common in the neovim plugin space. I'd prefer that the new LSP support it, rather than having every plugin provide duplicated types that may drift out of sync.

yeah, the duplication also bothers me (though as a user of the plugin the warning bother me a bit more :)

Unfortunately the intended way to do it in emmylua (using Partial<T>) is not supported in lua_ls.
Also it seems like emmylua is not intending to support the lua_ls way according to EmmyLuaLs/emmylua-analyzer-rust#871 and EmmyLuaLs/emmylua-analyzer-rust#328

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.

Partial config annotations are incompatible with EmmyLua

2 participants