Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugins/copilot-lua: migrate to mkNeovimPlugin #2742

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HeitorAugustoLN
Copy link
Member

No description provided.

@HeitorAugustoLN HeitorAugustoLN force-pushed the copilot-lua-migrate branch 4 times, most recently from 259664b to 95d347d Compare December 25, 2024 11:54
jumpPrev = keymapOption "[[" "Keymap for jumping to the previous suggestion.";

jumpNext = keymapOption "]]" "Keymap for jumping to the next suggestion.";
keymapOption = defaultNullOpts.mkNullableWithRaw (with types; either (enum [ false ]) str);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
keymapOption = defaultNullOpts.mkNullableWithRaw (with types; either (enum [ false ]) str);
mkKeymapOption = defaultNullOpts.mkNullableWithRaw (with types; either (enum [ false ]) str);

It makes it clearer that it is a function.

name = "copilot-lua";
moduleName = "copilot";
packPathName = "copilot.lua";
package = "copilot-lua";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
package = "copilot-lua";

package defaults to name.

keymap = {
accept = keymapOption "<M-l>" "Keymap for accepting the suggestion.";
filetypes =
defaultNullOpts.mkAttrsOf types.bool
Copy link
Member

Choose a reason for hiding this comment

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

Can you take this opportunity to switch to mkAttrsOf' and provide the example key ?

copilot_node_command = lib.mkOption {
type = types.str;
default = lib.getExe pkgs.nodejs-18_x;
example = lib.getExe pkgs.nodejs;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
example = lib.getExe pkgs.nodejs;
example = lib.literalExpression "lib.getExe pkgs.nodejs";

I guess.

};
};
};
settingsExample = {
Copy link
Member

Choose a reason for hiding this comment

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

Please, keep this example shorter as it is the one that will be used in the documentation.
Target 5-10 options only.

The example test case in the test file can be as big as you want though.

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