Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: nil root_dir #51

Open
3 tasks done
Tmpod opened this issue Jan 19, 2024 · 3 comments
Open
3 tasks done

bug: nil root_dir #51

Tmpod opened this issue Jan 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Tmpod
Copy link

Tmpod commented Jan 19, 2024

Did you check docs and existing issues?

  • I have read all the neoconf.nvim docs
  • I have searched the existing issues of neoconf.nvim
  • 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 Tmpod added the bug Something isn't working label Jan 19, 2024
@PyDev19
Copy link

PyDev19 commented Jan 30, 2024

same issue here don't know how to resolve it

@Youngsie1997
Copy link

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

@ecruzolivera
Copy link

ecruzolivera commented Feb 19, 2024

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

if opts.root_dir then
local root_dir = initial_config.root_dir
initial_config.root_dir = function(...)
local b = root_dir(...)

Im not familiar with lua, but should not be:

 if initial_config.root_dir then

or

local root_dir = opts.root_dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants