Skip to content

Conversation

midischwarz12
Copy link
Contributor

@midischwarz12 midischwarz12 commented Aug 29, 2025

Sanity Checking

  • I have updated the [changelog] as per my changes
  • I have tested, and self-reviewed my code
  • My changes fit guidelines found in [hacking nvf]
  • Style and consistency
    • I ran Alejandra to format my code (nix fmt)
    • My code conforms to the [editorconfig] configuration of the project
    • My changes are consistent with the rest of the codebase
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas
    • I have added a section in the manual
    • (For breaking changes) I have included a migration guide
  • Package(s) built:
    • .#nix (default package)
    • .#maximal
    • .#docs-html (manual, must build)
    • .#docs-linkcheck (optional, please build if adding links)
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

Add a 👍 reaction to pull requests you find important.

Copy link

github-actions bot commented Aug 29, 2025

🚀 Live preview deployed from bf485ab

View it here:

Debug Information

Triggered by: midischwarz12

HEAD at: codecompanion-extensions

Reruns: 1352

Soliprem
Soliprem previously approved these changes Aug 29, 2025
Comment on lines 299 to 303
extensions = mkOption {
type = nullOr luaInline;
default = null;
description = "Extensions for codecompanion";
Copy link
Owner

Choose a reason for hiding this comment

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

This will be converted to nil by default. Does code-companion really support this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@NotAShelf I'm not 100% sure how nvf is turning these options into lua code. I couldn't find where it traverses these and generates lua. But I kind of assumed that if it was null, it wouldn't generate the luaInLine at all. I think that's what happens with the adapter options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did test this with the extensions set. And it seemed to work. I probably should test this with the extensions unset as well though.

Copy link
Owner

Choose a reason for hiding this comment

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

@midischwarz12
Copy link
Contributor Author

Ah, okay. This is ready. But there is a merge conflict with the release notes. So I'll have to go resolve this real quick.

@midischwarz12 midischwarz12 force-pushed the codecompanion-extensions branch from 92d5f7b to dcde353 Compare September 2, 2025 13:29
@midischwarz12
Copy link
Contributor Author

@NotAShelf Ready to merge

github-actions bot pushed a commit that referenced this pull request Sep 2, 2025
'';
};

extensions = mkOption {
Copy link
Owner

Choose a reason for hiding this comment

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

I believe you have Fundamentally Misunderstood how setupOpts is supposed to work. Normally, the setupOpts attribute set ({}) converts to a Lua table. In the documentation section you can find how Nix primitives are converted to Lua.

In this case,adding extensions is not strictly necessary; the setupOpts table is freeform and the user can already pass

extensions = { /* nix here */}

and it would be converted to the Lua expression. With type = luaInline, howevr, the user can ONLY pass inline Lua values, which defeats the purpose of using nvf. The type should be attrsOf anything, and to justify the addition of an option I'd like you to

  1. Add an example in mkOption
  2. Better utilize description.

Otherwise there is no need for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think I'm misunderstanding. I read through the docs you sent when you sent them previously. But from what I remember, there were quite a few call backs for these plugins and made more sense to just have inline lua.

I'll poke around more and look into doing this without the explicit inline extension option.


[midischwarz12](https://github.com/midischwarz12):

- Add extension support for [codecompanion-nvim].
Copy link
Owner

Choose a reason for hiding this comment

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

"Add extension support is" misleading; we already hid it, it was just implicit. Better describe the change per my comment in the Nix section.

Copy link
Contributor Author

@midischwarz12 midischwarz12 Sep 2, 2025

Choose a reason for hiding this comment

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

What do you mean by "we already hid it"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe "explicit codecompanion-nvim extension option" would be more accurate then?

Copy link
Owner

Choose a reason for hiding this comment

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

had* it

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants