1

I really enjoy coc-pyright and use it all the time for everything. But it can't jump to Pytest fixture definitions, and there are no plans to include such a feature.

Pyright doesn't include any knowledge of third-party libraries beyond what is provided to it in type stubs or type annotations, and we don't have any plans to add hard-coded logic that is library-specific.

My vscode-using friends can jump to fixture definitions (including fixtures created in conftest.py) because the feature has been built into Pylance for some years now.

The Jedi language server (and by extension coc-jedi) can do this but, from what little I've seen, is less featureful than coc-pyright in every other respect.

Installing both is not supported (coc-jedi say not to install it at the same time as coc-python which has been superceded by coc-pyright)

Is there a way I can install coc-jedi but only use it for <Plug>(coc-definition) and keep using coc-pyright for everything else?

Here's a snippet to demonstrate Pytest fixtures, and a gif showing how coc-defintion works with coc-jedi:

import pytest


@pytest.fixture
def my_fixture():
    pass


def test_my_test(my_fixture):
    pass

Using Jedi to jump to Pytest definition

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.