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

Adding quick-lint-js to my LazyVim config causes vim to stop working. #1195

Open
tacolegs2004 opened this issue Jan 26, 2024 · 3 comments
Open
Assignees

Comments

@tacolegs2004
Copy link

tacolegs2004 commented Jan 26, 2024

I tried to add the plugin to my LazyVim config. However, once I added the following code to my config through a file called 'quick-lint-js.lua', whenever I ran 'nvim' in my terminal, Neovim simply wouldn't open.

return {
    'quick-lint/quick-lint-js', 
    rtp = 'plugin/vim/quick-lint-js.vim', 
    tag = '3.1.0', 
    opt = true
}

EDIT: I converted the packer.nvim snippet from here to a LazyVim return.

@strager strager self-assigned this Feb 10, 2024
@strager
Copy link
Collaborator

strager commented Feb 10, 2024

The reason that LazyVim is quitting on start is that lazy.nvim is running quick-lint-js's test suite. (The test suite script exits when tests pass.)

Why does lazy.nvim run the test suite? Because lazy.nvim isn't respecting the rtp setting (which doesn't seem to exist; lazy.nvim always adds the whole Git repo to runtimepath) and because lazy.nvim recursively executes .vim files in quick-lint-js's plugin directory.

lazy.nvim's config hook runs after executing the .vim files, so we can't stop this behavior using a config hook. The cond hook does happen early enough, though, so we can exploit it to get lazy.nvim to not totally explode:

return {
  "quick-lint/quick-lint-js",
  tag = "3.1.0",
  cond = function(plugin)
    -- TODO(strager): Don't make this happen multiple times.
    plugin.dir = plugin.dir .. "/plugin/vim/quick-lint-js.vim"
    return true
  end
}

But this doesn't make quick-lint-js work yet. More investigation is needed.

@strager
Copy link
Collaborator

strager commented Feb 10, 2024

Here's a partially-working config for LazyVim:

return {
  "quick-lint/quick-lint-js",
  tag = "3.1.0",
  cond = function(plugin)
    -- TODO(strager): Don't make this happen multiple times.
    plugin.dir = plugin.dir .. "/plugin/vim/quick-lint-js.vim"
    return true
  end,
  config = function(_plugin)
    require("lspconfig/quick_lint_js").setup {}
  end,
}

@strager
Copy link
Collaborator

strager commented Feb 10, 2024

I filed an issue with lazy.nvim. folke/lazy.nvim#1319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants