mattn / mattn/vim-lsp-settings

Pyls and user packages

Open
#577 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
1.4k
Forks
245
Avg merge
3m
Merged PRs (30d)
1

Description

Hello,

Thanks for the open source work!

I have an issue with pyls. If I install it with vim-lsp-settings, using :LspInstallServer pyls, pyls does not see my user installed packages.

For instance, if I have a package installed with pip install django --user, autocomplete will not work on import django; django.*, whereas it is working with the standard library.

However, if I install pyls manually with pip install python-language-server --user and start it directly from vim-lsp with :

if executable('pyls')
    " pip install python-language-server
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'allowlist': ['python'],
        \ })
endif

In that case, pyls works fine and autocomplete works on import django; django.*.

It might come from the virtualenv used to install pyls. Any idea how to fix this?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing :LspInstallServer pyls in vim-lsp-settings and compare the environment it uses with the manually launched pyls command. Reproduce the django autocomplete case and determine what must change so installed user packages are visible; done means the installed server provides autocomplete for that import.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, vim
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.