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

Closed
3 tasks done
Tmpod opened this issue Jan 19, 2024 · 4 comments · Fixed by #70
Closed
3 tasks done

bug: nil root_dir #51

Tmpod opened this issue Jan 19, 2024 · 4 comments · Fixed by #70
Labels
bug Something isn't working stale

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

Copy link
Contributor

github-actions bot commented Jul 6, 2024

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 github-actions bot added the stale label Jul 6, 2024
@folke folke linked a pull request Jul 6, 2024 that will close this issue
@folke folke closed this as completed in f9dcd17 Jul 6, 2024
folke pushed a commit that referenced this issue Jul 7, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.3.0](v1.2.2...v1.3.0)
(2024-07-07)


### Features

* added support for ruff_lsp. Fixes
[#45](#45)
([a198a8c](a198a8c))
* **util:** util.pick_root_dir
([197c17a](197c17a))


### Bug Fixes

* **build:** fix schema generation issues
([#63](#63))
([45484f5](45484f5)),
closes [#52](#52)
[#60](#60)
* **commands:** checkhealth. Fixes
[#29](#29)
([245bb87](245bb87))
* deprecation warnings on 0.11
([c6e2d96](c6e2d96))
* **deprecation:** remove use of deprecated API functions
([#59](#59))
([983a93b](983a93b))
* flatten
([cdbd1f2](cdbd1f2))
* **health:** remove deprecated API warnings
([#28](#28))
([9625a17](9625a17))
* **health:** remove nvim-treesitter dependency
([#44](#44))
([3374276](3374276))
* **json:** set `null` values to `nil`
([2f131d0](2f131d0))
* **lspconfig:** dont deepcopy the full config. Do settings only
([37a7205](37a7205))
* normalize paths. Fixes
[#33](#33)
([e0835bd](e0835bd))
* remove nickel_ls
([ca5246f](ca5246f))
* **util:** check that root_dir exists. Fixes
[#56](#56). Closes
[#51](#51)
([f9dcd17](f9dcd17))
* **util:** normalize paths returned by `Util.file_patterns`
([#35](#35))
([7c34c86](7c34c86))
* **volar:** volar schema
([#64](#64))
([4274159](4274159))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants