sublimelsp / LSP-pylsp

Convenience package for the Python Language Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autocompletions not being found for numpy

jatkinson1000 opened this issue · comments

I have installed LSP-pylsp on ST4 and generally everything is working well.
Only problem I have is that it isn't providing me with any autocompletions for numpy.

I have everything in a venv and am pretty sure I'm pointing to the right location with the following in a .sublime-project file:

"settings": {
    "LSP": {
        "LSP-pylsp": {
            "command": [
                "/Path/To/venv/my_venv/bin/pylsp",
            ],
            "settings": {
   	        // Jedi config
   	        "pylsp.plugins.jedi.environment": "/Path/To/venv/my_venv",
   	        // Linter config:
   	        "pylsp.plugins.pycodestyle.enabled": false,
   	        "pylsp.plugins.flake8.enabled": true,
   	        "pylsp.configurationSources": ["flake8"],
   	        // formatter config
   	        "pylsp.plugins.autopep8.enabled": false,
   	        "pylsp.plugins.pylsp_black.enabled": true,
   	        "pylsp.plugins.pylsp_black.cache_config": true,
   	        "pylsp.plugins.pylsp_black.line_length": 88,
   	        "pylsp.plugins.pylsp_black.preview": true,
            },
        },
    },
},

Generally I am getting autocompletion.
If I start typing import it suggests modules in my venv:
image
image

It then suggests autocompletions for functions in that module:
image

However, this is not working for numpy.
It detects numpy in my venv when I come to import it (see image above), but does not provide any numpy autocompletion when using it:
image

If you can work out what's going wrong I'd be really grateful, and apologies if I've missed something somewhere - I've been battling with setting this up all afternoon. Thanks.

Interestingly it does seem to work for an older version of numpy I have (1.20.3).
If I upgrade this to the version I was using above (1.23.4) I then experience the same error.

Further investigation suggests this is an issue with Jedi following changes to numpy in recent versions and is still open.
davidhalter/jedi#1864

Guess this can probably be closed/removed as it's seemingly not an issue with this codebase.

Yep, looks like a Jedi issue.
Maybe can ping the jedi issue since it didn't have any activity in a while.