neoconf.nvim icon indicating copy to clipboard operation
neoconf.nvim copied to clipboard

bug: nil root_dir

Open Tmpod opened this issue 1 year ago • 3 comments

Did you check docs and existing issues?

  • [X] I have read all the neoconf.nvim docs
  • [X] I have searched the existing issues of neoconf.nvim
  • [X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.9.5 Release

Operating system/version

Linux 6.6

Describe the bug

When starting a Slint LSP, I get the following error:

[lspconfig] unhandled error: ....local/share/nvim/lazy/neoconf.nvim/lua/neoconf/util.lua:54: attempt to call upvalue 'root_dir' (a nil value)

And the server isn't started.

Steps To Reproduce

  1. Install the server through Mason
  2. Open a Slint file
  3. If you don't have automatic filetype detection already, do :se ft=slint
  4. If the LSP didn't try to start automatically, do :LspStart
  5. You should see the error pop out.

Expected Behavior

The LSP starts without errors.

Repro

-- With this repro, the server still doesn't start but I don't get the error either... 
-- My regular setup uses LazyVim. Should I open an issue there?

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
	"folke/tokyonight.nvim",
	"folke/neoconf.nvim",
	"williamboman/mason-lspconfig.nvim",
	{
		"williamboman/mason.nvim",
		config = function()
			require("mason").setup()
			require("mason-lspconfig").setup({
				ensure_installed = { "slint_lsp" },
			})
		end,
	},
	"neovim/nvim-lspconfig",
	-- add any other plugins here
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Tmpod avatar Jan 19 '24 12:01 Tmpod

same issue here don't know how to resolve it

PyDev19 avatar Jan 30 '24 01:01 PyDev19

Same issue here also would love to know how to resolve it if either of you manage to find a solution.

Youngsie1997 avatar Jan 30 '24 23:01 Youngsie1997

same issue here, im using astronvim version: v3.43.4 and neoconf version 1.2.2 main commit f8947e9

https://github.com/folke/neoconf.nvim/blob/4ef6c6c5882e7e16209173fb8c47414202843384/lua/neoconf/util.lua#L51-L54

Im not familiar with lua, but should not be:

 if initial_config.root_dir then

or

local root_dir = opts.root_dir

ecruzolivera avatar Feb 19 '24 16:02 ecruzolivera

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]