pappasam / jedi-language-server

A Python language server exclusively for Jedi. If Jedi supports it well, this language server should too.
MIT License
597 stars 45 forks source link

No completion for matplotlib's subplot when using their new coding format #64

Closed listout closed 3 years ago

listout commented 3 years ago

I was following the coding format from the 3.1.0 doc. I believe they call this the new object oriented approach.

I was not able to get completions, how ever if I use subplots in regular approach I get completions as expected.

Codes and Screenshots

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x ** 2)

fig, (ax1, ax2) = plt.subplots(2)

fig.suptitle('Vertical stacked plots') # autocomplete here too
ax1.

python1

However after writing the complete functions, jedi language server doesn't show any error too, checked with both native jedi language server and pylint.

Information

Environment: I use coc-jedi with the coc.nvim plugin in vim/nvim. OS: Linux Editor: Vim/Neovim with coc.nvim as an lsp client

listout commented 3 years ago

Found a similar issue

pappasam commented 3 years ago

In this case, I think you're in luck! Jedi is smart enough to understand type hints, and there are typehints for matplotlib / numpy / pandas provided in another package!

https://pypi.org/project/data-science-types/

Just install that package in your project and you should be good to go!