Auto-import missing package prefix

  Kiến thức lập trình

Currently, I have quite a solid setup with my neovim, and I’m pretty happy so far, there is just one thing annoying me which is the auto-import feature suggested by the nvim-cmp

I have a structure like

src/
    models/
           modelA.py

When I’m using a class reference inside the modelA, the auto-import tool suggests the import like…

from models.modelA import Potatoes

And I would expect something like

from src.models.ModelA import Potatoes

I’ve been reading the documentation but nothing really effective for this issue atm.

LEAVE A COMMENT