Skip to content

docs(types): annotate setup config and actions module for LuaLS#140

Merged
dlyongemallo merged 1 commit intomainfrom
export_types_for_setup
Apr 24, 2026
Merged

docs(types): annotate setup config and actions module for LuaLS#140
dlyongemallo merged 1 commit intomainfrom
export_types_for_setup

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

Closes #131.

Copilot AI review requested due to automatic review settings April 23, 2026 21:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/@alias annotations 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.

Comment thread lua/diffview/actions.lua
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lua/diffview/config.lua Outdated
Comment thread lua/diffview/config.lua Outdated
Comment thread lua/diffview/config.lua Outdated
Comment thread lua/diffview/config.lua Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lua/diffview/ui/panel.lua
Comment thread lua/diffview/config.lua
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with position="auto" and asserts the resolved side/orientation (and that height-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.

Comment thread lua/diffview/ui/panel.lua
Comment thread doc/diffview.txt Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/height validators accept any Lua number (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 validating width/height as integers (or coercing via math.floor/math.tointeger) to match the documented integer type.
      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.

Comment thread lua/diffview/ui/panel.lua Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lua/diffview/ui/panel.lua
Comment thread lua/diffview/config.lua Outdated
Comment thread lua/diffview/config.lua Outdated
Comment thread lua/diffview/config.lua Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread CONTRIBUTING.md
Comment thread lua/diffview/ui/panel.lua
Comment thread lua/diffview/config.lua
@dlyongemallo dlyongemallo force-pushed the export_types_for_setup branch from bbeed9c to f421cff Compare April 24, 2026 08:29
@dlyongemallo dlyongemallo force-pushed the export_types_for_setup branch from f421cff to 02f8a26 Compare April 24, 2026 08:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dlyongemallo dlyongemallo merged commit 4d8b260 into main Apr 24, 2026
7 checks passed
@dlyongemallo dlyongemallo deleted the export_types_for_setup branch April 24, 2026 08:46
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.

feature request: export types for setup function

2 participants