Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use pyright's auto import feature? #90

Closed
xulongwu4 opened this issue Sep 14, 2020 · 5 comments
Closed

How to use pyright's auto import feature? #90

xulongwu4 opened this issue Sep 14, 2020 · 5 comments

Comments

@xulongwu4
Copy link

Can you give a bit instruction on how to use pyright's auto import feature with coc-pyright?

@xulongwu4
Copy link
Author

For anyone coming to this issue, I found a very good illustration of the auto-import behavior in vscode. Some very relevant discussions are here.

@roblevy
Copy link

roblevy commented Feb 1, 2021

I still don't know how to use the auto-import feature, after watching the gif and reading the discussion you posted. Is it actually possible to get auto-import?

@jeanlucthumm
Copy link

Can we reopen this

@fannheyward
Copy link
Owner

Set "python.analysis.diagnosticMode": "workspace" in your coc-settings.json, you will get auto-import suggestions.

@davidonlaptop
Copy link

YMMV but it seems that the default indexing isn't deep enough for auto-import to work when the function or class you import is not at the root level, so here's what I had to put in my settings.json for it to work properly:

{
  "python.analysis.autoImportCompletions": true,
  "python.analysis.indexing": true,
  "python.analysis.packageIndexDepths": [
    {
      "name": "",
      "depth": 3
    },
    
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants