tomv564 / pyls-mypy

Mypy plugin for the Python Language Server
MIT License
110 stars 62 forks source link

Doesn't seem to work #50

Closed horseinthesky closed 3 years ago

horseinthesky commented 3 years ago

Here is my pyls config:

lspconfig.pyls.setup {
  cmd = {"pyls"},
  filetypes = {"python"},
  settings = {
    pyls = {
      configurationSources = {"flake8"},
      plugins = {
        jedi_completion = {enabled = true},
        jedi_hover = {enabled = true},
        jedi_references = {enabled = true},
        jedi_signature_help = {enabled = true},
        jedi_symbols = {enabled = true, all_scopes = true},
        pycodestyle = {enabled = false},
        flake8 = {
          enabled = true,
          ignore = {},
          maxLineLength = 160
        },
        pyls_mypy = {enabled = true, live_mode = true},
        pyls_isort = {enabled = true},
        yapf = {enabled = false},
        pylint = {enabled = false},
        pydocstyle = {enabled = false},
        mccabe = {enabled = false},
        preload = {enabled = false},
        rope_completion = {enabled = false}
      }
    }
  },
  on_attach = on_attach
}

No errors from pyls_mypy image

Running mypy from shell show an error:

mypy bla.py
bla.py:8: error: Argument 1 to "bla" has incompatible type "int"; expected "List[str]"
Found 1 error in 1 file (checked 1 source file)
janwaldmann commented 3 years ago

See #44 for the underlying reason. As a workaround, installing directly from the repo via

python -m pip install git+https://github.com/tomv564/pyls-mypy.git

works for me.

horseinthesky commented 3 years ago

@janwaldmann Works for me also. Thank you. It seems like maintenance of pyls and its plugins is suffering from the lack of support.

I'm looking for a language server for Neovim 0.5 and the choice is pyls and pyright. I like pyls due to robust feature pack (linting and formatting) where pyright needs help of something like efm for formatting. But pyls seems barely alive =(

janwaldmann commented 3 years ago

@horseinthesky it's a bit off-topic, but I did the very same recently and decided to use the jedi-language-server (supports jedi 0.18; no rope) along with diagnostic-languageserver for linting and formatting. Both seem to work well together in Neovim so far.

horseinthesky commented 3 years ago

Thanks anyway for the workaround.

Mohan-cloud commented 3 years ago

@horseinthesky Is it working now? I can't get it to work even after installing the git version.

horseinthesky commented 3 years ago

@horseinthesky Is it working now? I can't get it to work even after installing the git version. Was working at that moment.

I've moved to jedi-language-server and run my flake8/mpy/black via efm-language-server. I prefer this setup now .

Mohan-cloud commented 3 years ago

Oh, alright! Thanks!