Open harryjubb opened 5 years ago
any news?
It have to be done by the language server, when MPLS support it, you should be able to use it with coc.nvim.
This seems to be working now, not sure when exactly it was introduced but see
https://github.com/microsoft/python-language-server/issues/19
It still doesn't work for me in coc. In vscode, I can trigger this by hover my mouse to the symbol and clicking Quick fix...
. But in coc, even if I :call CocActionAsync('doQuickfix')
, I got [coc.nvim] No quickfix action available
It's feature of MPLS, you won't have this when jedi enabled.
I have "python.jediEnabled": false
in my coc-settings.json, I also tried calling :CocCommand python.upgradePythonLanguageServer
, but the result is the same.
Hm, the client code may need some change as well, please give me an example which works with VSCode.
Haven't tried 'quick fix', but the auto import option is there for me when I do 'code actions' on the unimported module.
It's feature of MPLS, you won't have this when jedi enabled.
Looks like it's feature of pylance, new language server for python. And mpls will be deprecated.
Our long-term plan is to transition our Microsoft Python Language Server users over to Pylance and eventually deprecate and remove the old language server as a supported option.
I have been developing a plugin that would satisfy the feature.
https://github.com/relastle/vim-nayvy (Especially coc.nvim custom source part is what you really want https://github.com/relastle/vim-nayvy#223-cocnvim)
The plugin uses some heuristics, but it seems works so well for me to import functions or classes inside python's project (or you can configure the statements to import as you like, pls see https://github.com/relastle/vim-nayvy#3-configurations).
I believe pyright is doing this already
On Tue, Aug 11, 2020 at 4:58 PM Hiroki Konishi notifications@github.com wrote:
I have been developing a plugin that would satisfy the feature.
https://github.com/relastle/vim-nayvy (Especially coc.nvim custom source part is what you really want https://github.com/relastle/vim-nayvy#223-cocnvim)
The plugin uses some heuristics, but it seems works so well for me to import functions or classes inside python's project (or you can configure the import statements to import as you like see https://github.com/relastle/vim-nayvy#3-configurations).
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/neoclide/coc-python/issues/90#issuecomment-672042994, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7WGR4EA22FK3HYQGV4WHTSAFTBHANCNFSM4IVH4FZA .
I believe pyright is doing this already
Yesterday i installed coc-pyright, and it's pretty good expirience out of the box, including completions, renaming and autoimports. But for now it's lacking support for django dynamic methods, like get_FOO_choices for fields with choices, and the doesn't plan to add plugin support until project is more mature.
@last-partizan Can you elaborate a bit about how do to autoimports with coc-pyright? Thanks.
@xulongwu4 they just works, you write datac
, it shows menu with autoimport variants.
Hi,
Fantastic tool!
Is there any scope to support automatic imports, for example, if I write:
That then automatically (or via a
:CocCommand
) adds:At the top of the file; or if there are multiple possibilities, offers the user a choice in a list.
I haven't used it, but it looks like it would be functionality similar to vscode-importmagic. It looks like it is proposed for the Microsoft Python Language Server also.