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/none-ls: switch to mkNeovimPlugin #1727

Merged

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Jun 20, 2024

Part one refactoring none-ls (#1705): switch the top-level plugin options to use mkNeovimPlugin and rfc42-style settings.

lsp-format

This PR maintains the existing option enableLspFormat, a legacy option that sets none-ls's on_attach to require('lsp-format').on_attach. There are some issues with this option, but removing or refactoring it is not a focus for this initial PR.

I did update the option description though: fixes #1690.

with() args

The various sources have a withArgs option (plugins.none-ls.sources.*.*.withArgs), which is a lua-string type. Switching this to rfc42-style settings would be nice, but is not in scope for this PR. (Upstream docs, experimental draft PR).

Non-builtin sources

The settings.sources option (previously sourcesItems) can list builtin sources, along with custom sources and "third-party" sources. We're currently only considering builtin sources (as listed in builtins.json). Properly supporting other sources is not in scope for this PR.

@MattSturgeon MattSturgeon force-pushed the none-ls_mkNeovimPlugin branch 2 times, most recently from ed93b84 to 630cc82 Compare June 20, 2024 07:49
@MattSturgeon MattSturgeon requested a review from a team June 20, 2024 07:55
plugins/none-ls/default.nix Outdated Show resolved Hide resolved
Comment on lines 213 to 224
# TODO: Upstream's description:
# description = ''
# Defines a list of sources for null-ls to register.
# Users can add built-in sources (see [BUILTINS]) or custom sources (see [MAIN]).
#
# If you've installed an integration that provides its own sources and aren't
# interested in built-in sources, you don't have to define any sources here. The
# integration will register them independently.
#
# [BUILTINS]: https://github.com/nvimtools/none-ls.nvim/blob/main/doc/BUILTINS.md
# [MAIN]: https://github.com/nvimtools/none-ls.nvim/blob/main/doc/MAIN.md
# '';
Copy link
Member

Choose a reason for hiding this comment

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

Same, this should be dealt with here I think.

Copy link
Member Author

@MattSturgeon MattSturgeon Jun 25, 2024

Choose a reason for hiding this comment

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

This is for future reference, currently that option should only be used by the sources.**.enable option implementation, hence visible=false and keeping the previous description.

In the future this option may be useful for custom and/or third-party sources, so we'll likely take upstream's description into account.

I could remove the commented out upstream description if you like?

Copy link
Member Author

Choose a reason for hiding this comment

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

Since the option is visible = false anyway, I've included both in the description and removed the commented out one.

Comment on lines +24 to +25
# This is implied:
# enableLspFormat = true;
Copy link
Member

Choose a reason for hiding this comment

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

Just remove it entirely then, no ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could do, but since this is kind of a weird option (default = plugins.lsp-format.enable) and also an option we might remove/rework in the future, I thought it was useful to note the implication.

Up to you.

Copy link
Member

Choose a reason for hiding this comment

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

No it's fine like this.

Copy link
Member

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +24 to +25
# This is implied:
# enableLspFormat = true;
Copy link
Member

Choose a reason for hiding this comment

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

No it's fine like this.

@GaetanLepage GaetanLepage requested a review from traxys June 27, 2024 09:56
@MattSturgeon MattSturgeon merged commit ca8ac5f into nix-community:main Jun 27, 2024
1 check was pending
@MattSturgeon MattSturgeon deleted the none-ls_mkNeovimPlugin branch June 27, 2024 10:40
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.

[BUG] lsp-format should get enabled if enabling enableLspFormat
2 participants