docs(types): annotate setup config and actions module for LuaLS#140
docs(types): annotate setup config and actions module for LuaLS#140dlyongemallo merged 1 commit intomainfrom
setup config and actions module for LuaLS#140Conversation
There was a problem hiding this comment.
Pull request overview
Adds LuaLS-friendly type annotations for Diffview’s setup() config and actions module, improving editor completion/hover information for configuration and keymap actions (per #131).
Changes:
- Annotate
require("diffview").setup()with a user-facing config type (DiffviewConfig.user). - Introduce a comprehensive set of LuaLS
@class/@aliasannotations for config structure and action targets. - Document the maintenance checklist for config option changes in
CONTRIBUTING.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lua/diffview/init.lua | Adds LuaLS param type for setup(user_config) to point at the user config schema. |
| lua/diffview/config.lua | Defines DiffviewConfig / DiffviewConfig.user plus supporting aliases/classes to drive LuaLS completion across config + keymaps. |
| lua/diffview/actions.lua | Adds a DiffviewActions class and casts M to it so LuaLS can “see” dynamically-registered actions and action factories. |
| CONTRIBUTING.md | Adds guidance to keep defaults, types, and docs in sync when config options change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6321623 to
0ae2af7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0ae2af7 to
90931f2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
90931f2 to
0ae1192
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
lua/diffview/ui/panel.lua:214
- There’s no automated coverage for the newly-enabled
position="auto"behavior (only auto-width is tested). Adding a functional test that opens a split panel withposition="auto"and asserts the resolved side/orientation (and thatheight-driven row splits work, if supported) would help prevent regressions.
vim.validate({
position = valid_enum(config.position, { "left", "top", "right", "bottom", "auto" }),
relative = valid_enum(config.relative, { "editor", "win" }),
width = {
config.width,
function(v)
return v == nil or v == "auto" or type(v) == "number"
end,
"'auto' or number",
},
height = { config.height, "number", true },
win_opts = { config.win_opts, "table" },
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0ae1192 to
8758ec8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
lua/diffview/ui/panel.lua:213
- The split
width/heightvalidators accept any Luanumber(including non-integers).nvim_win_set_width()/nvim_win_set_height()require integer values, so a fractional value will pass validation and then error when resizing. Consider validatingwidth/heightas integers (or coercing viamath.floor/math.tointeger) to match the documentedintegertype.
width = {
config.width,
function(v)
return v == nil or v == "auto" or type(v) == "number"
end,
"'auto' or number",
},
height = { config.height, "number", true },
win_opts = { config.win_opts, "table" },
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8758ec8 to
3d07fe7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3d07fe7 to
bbeed9c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bbeed9c to
f421cff
Compare
f421cff to
02f8a26
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #131.