0
votes

I'm using vim with coc.nvim and the coc-python plugin.
In Pycharm for example, when I write a contextmanager class like:

class Foo:
  def __init__(self) -> None:
    pass  # some code
  
  def __enter__(self):
    pass  # some code 

  def __exit__(self, exc_type, exc_val, exc_tb):
    pass  # some code

Then during typing the __exit__() method I get the exc_* common args autocompleted for me (I know that these names don't have to be these exactly, but it's a convention). Can I get a similar behaviour with coc.nvim? Currently it doesn't do that. Same goes for autocompleting self at each method which is not a class or a static method.

1
Have you considered trying ultisnips? You can custom define whatever snippets you want. - Sarim Aleem

1 Answers

0
votes

It's called signatureHelp in LSP. It's not recommend to use coc-python now because Microsoft Python Language Server will be deprecated in future. You can use coc-pyright if you're using Python 3.

enter image description here