Replies: 2 comments 1 reply
-
Yes, this is definitely the case, so this indicates that something is wrong with your config (I also use nvim-cmp and do not have this issue). Adding a check might make sense (though under normal circumstances it should not be possible) but I would start by using the minimal init file in the issue template to determine what exactly is causing the issue. |
Beta Was this translation helpful? Give feedback.
-
This issue is related to path naming. Editing Peek.2022-11-11.15-29.mp4init.lua: local o = vim.o
o.shell = '/bin/bash'
require('packer').init({max_jobs = 5})
require('packer').startup(function()
use 'wbthomason/packer.nvim'
use "nvim-lua/plenary.nvim"
use {
'jose-elias-alvarez/null-ls.nvim',
config = function()
local null_ls = require("null-ls")
local F = null_ls.builtins.formatting
null_ls.setup({
sources = {
F.prettier,
},
})
end,
}
use {
'hrsh7th/nvim-cmp',
requires = { 'hrsh7th/cmp-nvim-lsp' },
config = function()
local cmp = require 'cmp'
cmp.setup({
sources = cmp.config.sources({
{name = 'nvim_lsp'},
}),
})
end,
}
end)
|
Beta Was this translation helpful? Give feedback.
-
When I typing in json, I got this error popup.
Error detected while processing TextChangedI Autocommands for "*": Error executing lua callback: ...ite/pack/packer/start/null-ls.nvim/lua/null-ls/utils.lua:171: attempt to index local 'line' (a nil value) stack traceback: ...ite/pack/packer/start/null-ls.nvim/lua/null-ls/utils.lua:171: in function 'make_params' ...ite/pack/packer/start/null-ls.nvim/lua/null-ls/hover.lua:8: in function 'handler' .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:112: in function 'handle' .../site/pack/packer/start/null-ls.nvim/lua/null-ls/rpc.lua:126: in function 'request' /usr/share/nvim/runtime/lua/vim/lsp.lua:1389: in function 'request' ...ck/packer/start/cmp-nvim-lsp/lua/cmp_nvim_lsp/source.lua:96: in function '_request' ...ck/packer/start/cmp-nvim-lsp/lua/cmp_nvim_lsp/source.lua:42: in function 'complete' .../nvim/site/pack/packer/start/nvim-cmp/lua/cmp/source.lua:314: in function 'complete' ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:287: in function 'complete' ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:169: in function 'callback' ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:219: in function 'autoindent' ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:161: in function 'on_change' ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/init.lua:312: in function 'callback' ...ite/pack/packer/start/nvim-cmp/lua/cmp/utils/autocmd.lua:49: in function 'emit' ...ite/pack/packer/start/nvim-cmp/lua/cmp/utils/autocmd.lua:23: in function <...ite/pack/packer/start/nvim-cmp/lua/cmp/utils/autocmd.lua:22> Press ENTER or type command to continue
Because
line
here is nil. After adding a check, it's work.Or if I remove
null_ls.builtins.formatting.prettier
source in init.lua.Don't know why a format source can be triggered on typing. I believe format source should only used on
vim.lsp.buf.format
.Beta Was this translation helpful? Give feedback.
All reactions