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

Help with migration from lsp-installer to mason.nvim #226

Open
kozikowskik opened this issue Sep 3, 2022 · 1 comment
Open

Help with migration from lsp-installer to mason.nvim #226

kozikowskik opened this issue Sep 3, 2022 · 1 comment

Comments

@kozikowskik
Copy link

Hi,
Today I tried to switch from lsp-installer to mason.nvim and mason-lspconfig.nvim but I'm facing problems or I'm doing something wrong in the configuration and I don't see what. For testing I prepared a fresh neovim installation with packer and minimum configuration required to run ray-x/navigator.lua, mason.nvim and mason-lspconfig.nvim.With :LspInstall I installed pyright.
As result, I want to have running pyright as my lsp-serve for python files but when I run :LspInfo on some dummy python script I'm getting information that any of lsp clients is attached to buffer.

          Use [q] or [Esc] to quit the window                                                                                                                                     
~                                                                                                                                                                                             
~                     Language client log: /root/.cache/nvim/lsp.log                                                                                                                          
~                     Detected filetype:   python                                                                                                                                             
~                                                                                                                                                                                             
~                     0 client(s) attached to this buffer:                                                                                                                                    
~                                                                                                                                                                                             
~                     Configured servers list:                                                                                                                                                
~                                                 

Additional informations

Neovim version:

root@749fbc5e5807:/# nvim --version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
root@749fbc5e5807:/# 

My nvim configuration file looks like that:

return require('packer').startup(function(use)
  -- Packer can manage itself
  use 'wbthomason/packer.nvim'

  use("williamboman/mason.nvim")
  use({
          "williamboman/mason-lspconfig.nvim",
          config = function()
                  require("mason").setup()
                  require("mason-lspconfig").setup({})
          end,
  })
  use {"neovim/nvim-lspconfig"}
  use({
          "ray-x/navigator.lua",
          requires = {
                  { "ray-x/guihua.lua", run = "cd lua/fzy && make" },
                  { "neovim/nvim-lspconfig" },
                  { "nvim-treesitter/nvim-treesitter" },
          },
          config = function()
                  require("navigator").setup({
                          debug = true,
                          mason = true,
                  })
          end,
  })
end)

When I run :LspInstall inside the buffer I'm getting list of available servers with information that pyright is already installed:

Please select which server you want to install for filetype "python":
1: jedi_language_server
2: pylsp
3: pyright (installed)
4: sourcery
Type number and <Enter> or click with the mouse (q or empty cancels):

Navigator.lua debug log

root@749fbc5e5807:/# cat  ~/.cache/nvim/gh.log 
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:105: lsp_installer: { "pyright" }
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:551: nil filetype, callback
[INFO][Sat Sep  3 12:58:42 2022] [3]...packer/start/navigator.lua/lua/navigator/diagnostics.lua:542: diag config {
  severity_sort = {
    reverse = true
  },
  underline = true,
  update_in_insert = false,
  virtual_text = {
    prefix = "__",
    source = true,
    spacing = 3
  }
}
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:651: {}
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:666: file:https:///test.py
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:605: running lsp setup python 1
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:608: loading for ft  python file:https:///test.py
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:324: pylsp
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:327: pylsp {}
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:403: loading pylsp name pylsp has lspinst false
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:439: mason server not installed pylsp
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:651: { 1 }
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:666: file:https:///test.py
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:605: running lsp setup python 1
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:608: loading for ft  python file:https:///test.py
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:324: pylsp
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:327: pylsp {}
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:403: loading pylsp name pylsp has lspinst false
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:439: mason server not installed pylsp
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:563: defer_fn py 
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:605: running lsp setup python 1
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:608: loading for ft  python file:https:///test.py
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:324: pylsp
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:327: pylsp {}
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:403: loading pylsp name pylsp has lspinst false
[INFO][Sat Sep  3 12:58:42 2022] [3].../start/navigator.lua/lua/navigator/lspclient/clients.lua:439: mason server not installed pylsp
@ray-x
Copy link
Owner

ray-x commented Sep 4, 2022

I create a feature request in mason: williamboman/mason-lspconfig.nvim#44

the reason is pylsp was install in virtual env path. It is not a binary lspconfig usually deal with.
You can setup pylsp by set navigator.setup{lsp={ pylsp ={ cmd={'mason_install_path'} } ATM

ray-x added a commit that referenced this issue Sep 4, 2022
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