Neovim-from-scratch icon indicating copy to clipboard operation
Neovim-from-scratch copied to clipboard

`null-ls.lua` can not be correctly required when in the `lsp` directory

Open thudjx opened this issue 2 years ago • 1 comments

I am following the lsp branch, i.e., the init.lua contains only:

require "user.options"
require "user.keymaps"
require "user.plugins"
require "user.colorscheme"
require "user.cmp"
require "user.lsp"

The problem is that, when nvim is launched from the directory ~/.config/nvim/lua/user/lsp, following error occurs:

Error detected while processing /home/dongjx/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /home/dongjx/.config/nvim/lua/user/lsp/null-ls.lua:7: attempt to index local 'null_ls' (a boolean value)
stack traceback:
        /home/dongjx/.config/nvim/lua/user/lsp/null-ls.lua:7: in main chunk
        [C]: in function 'require'
        /home/dongjx/.config/nvim/lua/user/lsp/init.lua:8: in main chunk
        [C]: in function 'require'
        /home/dongjx/.config/nvim/init.lua:6: in main chunk

If nvim is launched anywhere else, say, ~/.config/nvim/lua/user, everything goes normal.

thudjx avatar Jun 17 '22 05:06 thudjx

Is null-ls.nvim in the list that :PackerStatus returns?

brianrobt avatar Jun 23 '22 16:06 brianrobt