-
-
Notifications
You must be signed in to change notification settings - Fork 333
plugins.lsp: alias onAttach
to new lsp.onAttach
#3295
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
Conversation
3d88184
to
dbac55c
Compare
# If nvim-lspconfig is enabled: | ||
(mkIf config.plugins.lsp.enable { | ||
# Use the same `on_attach` callback as for the other LSP servers | ||
plugins.rustaceanvim.settings.server.on_attach = mkDefault '' | ||
function(client, bufnr) | ||
return _M.lspOnAttach(client, bufnr) | ||
end | ||
''; | ||
}) |
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.
The actual change in this file is removing:
# If nvim-lspconfig is enabled:
(mkIf config.plugins.lsp.enable {
# Use the same `on_attach` callback as for the other LSP servers
plugins.rustaceanvim.settings.server.on_attach = mkDefault ''
function(client, bufnr)
return _M.lspOnAttach(client, bufnr)
end
'';
})
Otherwise, the large diff is just removing the now-redundent mkMerge
, so it may be easier to read with whitespace changes hidden.
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.
Great !!!
This simplifies the impl by doing global on-attach logic in a `LspAttach` autocmd instead of adding lua lines to each server's individual `on_attach` callback. This is effectively a `mkAliasOptionModule` alias, other than the alias only being applied when `plugins.lsp.enable`.
dbac55c
to
5c52e8f
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 |
Follow up to #3280
Simplify the impl by doing global on-attach logic in
lsp.onAttach
(i.e. aLspAttach
autocmd) instead of adding lua lines to each server's individualon_attach
callback function.This is effectively a
mkAliasOptionModule [ "plugins" "lsp" "onAttach" ] [ "lsp" "onAttach" ]
alias, but it is only applied whenplugins.lsp.enable
is true.