stevanmilic / nvim-lspimport

Automatically resolves imports for undefined terms in neovim.
MIT License
61 stars 5 forks source link

more detailed instructions #1

Open russarr opened 9 months ago

russarr commented 9 months ago

Hi. The plugin doesn't work for me.

There is Note in Readme

NOTE: In order for pyright to resolve an import, module containing it should be used in the workspace; otherwise import won't be found. Hence the auto-import feature works well in modules loaded with pre-loaded imports.

Can you give more detailed instructions how to use it? Or give link to some guides?

P.S. Pyright imports works from autocompletion menu, so somehow pyright works with imports NVIM v0.10.0-dev-1816+g2d33a766a OS: Windows 10 22H2

stevanmilic commented 9 months ago

Hi, can you provide a minimal reproducible example?

Can you give more detailed instructions how to use it? Or give link to some guides?

There's more info on https://github.com/microsoft/pyright/issues/967#issuecomment-679417083, I can add that to the docs.

On the usage side, like noted it works well if you have a symbol you're trying to automatically import that's already imported somewhere else in the project workspace.

russarr commented 9 months ago

Pyright confugured with pyrightconfig.json

  1. I tried with the math module. Plugin message: "no unresolved import error"
    math.sqrt()
  2. or select from sqlaclhemy.sql Plugin message: "no import found for select" but with authocomplete i can import it изображение
stevanmilic commented 6 months ago

@russarr that's strange, if the pyright provides an "Auto-import" option then the plugin should be able to resolve the import. Can you please post pyright version and nvim version you're using?

UN-9BOT commented 5 months ago

image image