-
-
Notifications
You must be signed in to change notification settings - Fork 360
modules/lsp: init #3203
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
modules/lsp: init #3203
Conversation
9a70cba to
f468f48
Compare
Perhaps one day (when the top-level lsp module is more mature) we'll consider renaming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Minor nits:
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
|
We'll want to update the warning in |
6e7c698 to
1b5417d
Compare
| LSP servers to enable and/or configure. | ||
|
|
||
| This option is implemented using neovim's `vim.lsp` lua API. | ||
| If you prefer to use [nvim-lspconfig], see [`plugins.lsp`]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point, we should tweak this wording to suggest users use both lsp and plugins.lsp together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be updated in #3234 to reference plugins.lspconfig instead.
|
|
||
| config = | ||
| let | ||
| enabledServers = lib.filterAttrs (_: v: v.enable) cfg.servers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we introduce a name option (similar to other submodule sets like extraFiles), then we can simplify this to filter (v: v.enable) (attrValues cfg.servers)
submodule (
{ name, ... }:
{
options = {
name = lib.mkOption {
type = lib.types.str;
description = "The name of the language server, used as the first argument to `vim.lsp.enable` and `vim.lsp.config`.";
default = name;
};
# ...
};
}
)This would also allow users to configure the same server in different ways, using different attr-names, and decide which to use via the enable option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look at this in a followup PR
EDIT: #3239
|
Any ideas why this PR has been causing multi hour darwin CI jobs on buildbot? |
LSP is pretty central to Nixvim, so changing it causes many rebuilds in our CI test suite. |
|
If the jobs aren't important I'd appreciate it if you killed the builds immediately instead of leaving it to me to notice. Darwin CI usage by this repo isn't a problem yet but it is approaching that point. Unfortunately improving CI scheduling isn't simple and may not happen anytime soon. Disabling x86_64-darwin and only building aarch64-darwin is probably going to be the most workable option. |
That really shouldn't be the case; this PR doesn't modify anything used elsewhere in nixvim. It only introduces a new module that is (as of yet) unused. The only impact it should have is adding one derivation to the test suite (the Further, most of the CI runs that were problematic were failing with fairly simple eval errors (e.g., typos in function names). I really don't see any reason why any builds would've continued beyond a few minutes 🤔
Apologies; we usually try to cancel jobs whenever they aren't important. I guess we were distracted this time.
We appreciate being able to test our plugins on all platforms. However there are a handful of tests that aren't affected by platform; they are still declared via flake.parts (IDK if those platform-independant checks are actually causing any significant load though) If we had a way to configure which tests are run by CI (other than simply omitting those tests from the |
|
Unfortunately I think this project is the only one that would really benefit from this at the moment, same applies to the CI scheduling improvements. |
|
We still have a CI failure: https://buildbot.nix-community.org/#/builders/2852/builds/4316/steps/1/logs/stdio EDIT: #3203 (comment) Oddly, some jobs are showing as "cancelled (parent build was interrupted)" even though the build as a whole is still "building". EDIT: It was still "building" an hour later; I've clicked cancel now, but I'm not sure whether it's actually cancelled it or not. |
MattSturgeon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do you want to rebase or just queue?
| LSP servers to enable and/or configure. | ||
|
|
||
| This option is implemented using neovim's `vim.lsp` lua API. | ||
| If you prefer to use [nvim-lspconfig], see [`plugins.lsp`]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be updated in #3234 to reference plugins.lspconfig instead.
|
|
||
| config = | ||
| let | ||
| enabledServers = lib.filterAttrs (_: v: v.enable) cfg.servers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look at this in a followup PR
EDIT: #3239
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should really have more extensive tests here. Follow up PR
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
This pull request, with head sha This pull request will be automatically closed by GitHub.As soon as GitHub detects that the sha It is possible for this pull request to remain open if this detection does not happen, this usually happens when a force-push is done on this branch |
Introduce a top-level
lspNixvim module to wrap Neovim'svim.lspAPI.Example:
References:
Note: this is distinct from our
plugins.lspmodule which is backed by nvim-lspconfig.