LunarVim / LunarVim

🌙 LunarVim is an IDE layer for Neovim. Completely free and community driven.
https://www.lunarvim.org
GNU General Public License v3.0
18.08k stars 1.5k forks source link

setting lvim.lsp.installer.setup.automatic_installation and ensure_installed creates issues with files that should not have lsp #2987

Closed jmlucjav closed 2 years ago

jmlucjav commented 2 years ago

Problem description

Hi,

I have this conf:

lvim.lsp.installer.setup.automatic_installation = false
lvim.lsp.installer.setup.ensure_installed = {"pyright", "jsonls", "yamlls", "bashls"}

The intent is to have lsp working only in the servers I have in the ensure_installed list. I don't want any other lsp server running. With this config, if I open a md file, I get multiple errors about ltex-ls, most of them requires 'press ENTER' not onlywhen entering the buffer but when going to insert mode. Nvim is unusable for this fieltype now.

LunarVim version

rolling-90c9bd9

Neovim version (>= 0.7)

NVIM v0.8.0-dev-1014-g042d5df95

Operating system/version

Ubuntu 22.04 on WSL on Win10

Affected language servers

ltex-ls, possible others

Steps to reproduce

  1. install lunarvim with this config:

    lvim.lsp.installer.setup.automatic_installation = false
    lvim.lsp.installer.setup.ensure_installed = {"pyright", "jsonls", "yamlls", "bashls"}
  2. open a md file, see errors when loading buffer and entering insert mode

Actual behavior

image

image

Expected behavior

No lsp in md files, no errors

support info

LspInfo:

 Use [q] or [Esc] to quit the window

 Language client log: /home/jm/.local/state/nvim/lsp.log
 Detected filetype:   markdown

 1 client(s) attached to this buffer: 

 Client: null-ls (id: 2, pid: 5001, bufnr: [11])
    filetypes:       python, markdown
    autostart:       false
    root directory:  /mnt/c/Users/jm/Dropbox/porbase/scripts
    cmd:             nvim

 Other clients that match the filetype: markdown

 Config: ltex
    Refer to :h lspconfig-root-detection for help.
    filetypes:         bib, gitcommit, markdown, org, plaintex, rst, rnoweb, tex
    root directory:    Not found.
    cmd:               ltex-ls
    cmd is executable: Unable to find executable. Please check your path and ensure the server is installed
    autostart:         true
    custom handlers:   

 Configured servers list: ltex, yamlls

LvimInfo

 Use [q] or [Esc] to quit the window

 Language client log: /home/jm/.local/state/nvim/lsp.log
 Detected filetype:   markdown

 1 client(s) attached to this buffer: 

 Client: null-ls (id: 2, pid: 5001, bufnr: [11])
    filetypes:       python, markdown
    autostart:       false
    root directory:  /mnt/c/Users/jm/Dropbox/porbase/scripts
    cmd:             nvim

 Other clients that match the filetype: markdown

 Config: ltex
    Refer to :h lspconfig-root-detection for help.
    filetypes:         bib, gitcommit, markdown, org, plaintex, rst, rnoweb, tex
    root directory:    Not found.
    cmd:               ltex-ls
    cmd is executable: Unable to find executable. Please check your path and ensure the server is installed
    autostart:         true
    custom handlers:   

 Configured servers list: ltex, yamlls

logs

No response

Screenshots

No response

lvimuser commented 2 years ago

Output of :lua =lvim.lsp.automatic_configuration.skipped_servers ? Are you sure you don't have ltex somewhere? Does running :Mason shows ltex ls installed?

jmlucjav commented 2 years ago

output is:

{ "angularls", "ansiblels", "ccls", "csharp_ls", "cssmodules_ls", "denols", "ember", "emmet_ls", "eslint", "eslintls", "golangci_lint_ls", "graphql", "jedi_language_server", "ltex", "ocamlls", "phpactor", "psalm", "pylsp", "quick_lint_js",
"rome", "reason_ls", "scry", "solang", "solidity_ls", "sorbet", "sourcekit", "sourcery", "spectral", "sqlls", "sqls", "s
tylelint_lsp", "tflint", "svlangserver", "verible", "vuels" }
Press ENTER or type command to continue

Are you sure you don't have ltex somewhere?

you mean in skipped_servers? it is aready there, but it comes by default I think I also tried adding:

 vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "ltex" })

in my config just in case but nothing changes.

Does running :Mason shows ltex ls installed?

No, it does not

lvimuser commented 2 years ago

Is there a markdown.lua on ~/.local/share/lunarvim/site/after/ftplugin? If so, what's the contents.

jmlucjav commented 2 years ago

Is there a markdown.lua on ~/.local/share/lunarvim/site/after/ftplugin? If so, what's the contents.

no, there is none

lvimuser commented 2 years ago

Is there a markdown.lua on ~/.local/share/lunarvim/site/after/ftplugin? If so, what's the contents.

no, there is none

That suggests it's not LunarVim calling it.

cpea2506 commented 2 years ago

If this bug still exists:

jmlucjav commented 2 years ago

Went looking and installing from scratch again..It turns out I had a linked after dir that did contain a markdown.lua!!! Extremely sorry about that...Thanks for looking into this @lvimuser and @cpea2506 !