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: Neoconf improperly if lazy loaded by cmd #1070

Closed
3 tasks done
mehalter opened this issue Jul 6, 2023 · 1 comment · Fixed by #1101
Closed
3 tasks done

bug: Neoconf improperly if lazy loaded by cmd #1070

mehalter opened this issue Jul 6, 2023 · 1 comment · Fixed by #1101
Labels
bug Something isn't working

Comments

@mehalter
Copy link
Contributor

mehalter commented Jul 6, 2023

Did you check docs and existing issues?

  • I have read all the LazyVim docs
  • I have searched the existing issues of LazyVim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.1 release

Operating system/version

Arch Linux

Describe the bug

This is a bit of a continuation off of #945

Basically there is some tricky interactions here with the lazy loading of nvim-lspconfig and neoconf because Neoconf needs the lspconfig module to be loaded but none of the servers to be set up, but the servers are set up on the loading of lspconfig. So if you just open up LazyVim and run :Neoconf local for example you will not get the proper completion at all. We want to defer the setup Neoconf to the start of the loading of lspconfig but still before the servers are set up which breaks down when you load Neoconf directly and it loads lspconfig itself which messes up the loading order of things and breaks some of the functionality for that session. You have to restart and make sure you open a file before you try to modify something with :Neoconf

Workarounds:

  • Open a file before you run :Neoconf
  • Open the .neoconf file directly if you need to just edit that file

Steps To Reproduce

  1. run nvim
  2. On the dashboard before anything is loaded really, run :Neoconf local (or :Neoconf global)
  3. See that there is no completion

Here is a detailed terminal recording: https://asciinema.org/a/JRC1tGtOPwKRNun9aA3QrqQht

Expected Behavior

Loading neoconf lazily with :Neoconf should properly load things so that completion and everything works.

Repro

-- 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/LazyVim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@mehalter mehalter added the bug Something isn't working label Jul 6, 2023
@folke folke closed this as completed in 9e8ce28 Jul 12, 2023
@folke
Copy link
Collaborator

folke commented Jul 12, 2023

Should be properly fixed now. Again :)

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

Successfully merging a pull request may close this issue.

2 participants