You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's snippets of code from lsp-zero (bottom for full guide) that sets up a variety of plugins for LSP: lspconfig, mason, mason-lspconfig, nvim-cmp, etc.). I want an LSP-related init.lua or module that handles this aspect of the editor. How to best structure the ordering if these plugins?
Would it be the proper way to have nested dependencies, e.g. lspconfig depends on mason-lspconfig which depends on mason (since this implies the necessary loading order mason -> mason-lspconfig -> lspconfig? Then the snippets of code coresponding to that plugin goes in their opts/config. Or is this not necessary?
Would priorities be a good/simpler alternative to achieve ordering without nested dependencies?
Would it be better for all that snippet of code to e.g. go together under config for lspconfig even if they are for other plugins? That would make it easier to follow the whole picture.
I always had the thought that if I were to remove a plugin, I just needed to remove its plugin-spec and not worry that there is code that ties to the plugin except it being referenced as a dependency of a plugin, hence the nested dependencies and keeping code setting up a plugin to inside its plugin spec makes more sense but that also means requiring to jump back and forth the code to understand how LSP is set up.
Another "aspect" of the config are completions which I want to group the related configuration together (also involving multiple plugins and have some overlap with LSP. The "merging of the specs" in lazy.nvim is relevant here? A brief example is much appreciated).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There's snippets of code from lsp-zero (bottom for full guide) that sets up a variety of plugins for LSP: lspconfig, mason, mason-lspconfig, nvim-cmp, etc.). I want an LSP-related init.lua or module that handles this aspect of the editor. How to best structure the ordering if these plugins?
Would it be the proper way to have nested dependencies, e.g. lspconfig depends on mason-lspconfig which depends on mason (since this implies the necessary loading order
mason
->mason-lspconfig
->lspconfig
? Then the snippets of code coresponding to that plugin goes in theiropts
/config
. Or is this not necessary?Would priorities be a good/simpler alternative to achieve ordering without nested dependencies?
Would it be better for all that snippet of code to e.g. go together under
config
forlspconfig
even if they are for other plugins? That would make it easier to follow the whole picture.I always had the thought that if I were to remove a plugin, I just needed to remove its plugin-spec and not worry that there is code that ties to the plugin except it being referenced as a dependency of a plugin, hence the nested dependencies and keeping code setting up a plugin to inside its plugin spec makes more sense but that also means requiring to jump back and forth the code to understand how LSP is set up.
Another "aspect" of the config are completions which I want to group the related configuration together (also involving multiple plugins and have some overlap with LSP. The "merging of the specs" in lazy.nvim is relevant here? A brief example is much appreciated).
Beta Was this translation helpful? Give feedback.
All reactions