Replies: 3 comments 4 replies
-
It's hard to tell without seeing what's happening in your other files, but that That will partially load You probably have Due to that Normally In general, you always should make sure your specs don't load any plugins and use closures where needed. |
Beta Was this translation helpful? Give feedback.
-
@folke mason-lspconfig.opts()
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>mason-lspconfig.setup()
stack traceback:
...m/lazy/mason-lspconfig.nvim/lua/mason-lspconfig/init.lua:23: in function 'setup'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:373: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:371>
[C]: in function 'xpcall'
.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:381: in function 'config'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:348: in function '_load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:191: in function 'load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:342: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:341>
[C]: in function 'xpcall'
.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:341: in function '_load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:191: in function 'load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:342: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:341>
[C]: in function 'xpcall'
.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:341: in function '_load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:191: in function 'load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:123: in function 'startup'
/root/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:112: in function 'setup'
/root/.config/nvim/lua/config/lazy.lua:10: in main chunk
[C]: in function 'require'
/root/.config/nvim/init.lua:2: in main chunk
nvim-java.setup()
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>mason-lspconfig.setup()
stack traceback:
...m/lazy/mason-lspconfig.nvim/lua/mason-lspconfig/init.lua:23: in function 'setup'
...share/nvim/lazy/LazyVim/lua/lazyvim/plugins/lsp/init.lua:226: in function 'config'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:366: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:364>
nvim-java.opts()
nvim-java.setup() |
Beta Was this translation helpful? Give feedback.
-
@folke I see there is |
Beta Was this translation helpful? Give feedback.
-
I'm the author of nvim-java and since a lot of people seem to mess up the order of how things should be setup, I planed to add validations to show errors. But, I noticed some weird stuff.
In general, for
nvim-java
to work correctly,nvim-java.setup()
should be executed beforelspconfig.jdtls.setup()
because I wraplspconfig.jdtls.setup()
to do some configurations.This is my local config on lazyvim.
https://github.com/s1n7ax/lazyvim-dotnvim/blob/ad0b36789e1f40b2a8d6d0c93a58a6209be5c45b/lua/plugins/java/init.lua
require('utils.file').is_pkg_dir
is a util I created to load files from the local path if the path exists. On my PC, everything loads from the local paths.I added some console logs to find out in what order everything is being executed. I changed the
opts
value from table to functions and added logs. In plugins, I added logs at the start of the setup functions.Following is the order everything is being executed. Note that
> lspconfig.jdtls.setup()
is the log I added to jdtls setup function insidelspconfig
project.I have few questions.
nvim-java
is a dependency ofmason-lspconfig
, shouldn'tnvim-java.opts()
andnvim-java.setup()
be called beforemason-lspconfig.setup()
?> lspconfig.jdtls.setup()
andmason-lspconfig.setup()
is called way too many times?Beta Was this translation helpful? Give feedback.
All reactions