neoclide / coc-python

Python extension for coc.nvim, fork of vscode-python
574 stars 51 forks source link

VSCode python supports quick fix import #178

Closed ayroblu closed 4 years ago

ayroblu commented 4 years ago

I was looking at vscode and saw that they have auto imports quick fix here: https://code.visualstudio.com/docs/python/editing#_quick-fixes

Trying it out I setup coc-python it's not in the docs, assume it's not supports. Here's my CocInfo

## versions

vim version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar  3 2020 21:29:07)
node version: v10.15.3
coc.nvim version: 0.0.77-43e91e71af
term: Apple_Terminal
platform: darwin

## Output channel: prettier

## Output channel: Python

Starting Microsoft Python language server.
[Info  - 1:08:18 PM] Analysis cache path: /Users/me/Library/Caches/Microsoft/Python Language Server
[Info  - 1:08:18 PM] Microsoft Python Language Server version 0.5.45.0
[Info  - 1:08:18 PM] Workspace root: /Users/me/workspace/repo
[Info  - 1:08:18 PM] GetCurrentSearchPaths /Users/me/workspace/repo/subdir/env/bin/python 
[Info  - 1:08:18 PM] Interpreter search paths:
[Info  - 1:08:18 PM]     /Users/me/workspace/repo/subdir/env/lib/python3.7
[Info  - 1:08:18 PM]     /Users/me/workspace/repo/subdir/env/lib/python3.7/lib-dynload
[Info  - 1:08:18 PM]     /usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7
[Info  - 1:08:18 PM]     /Users/me/workspace/repo/subdir/env/lib/python3.7/site-packages
[Info  - 1:08:18 PM] User search paths:
[Info  - 1:08:18 PM]     /Users/me/workspace/repo/src
[Info  - 1:08:18 PM]     /Users/me/workspace/repo/subdir
[Info  - 1:08:18 PM]     /Users/me/workspace/repo/src/python
##########Linting Output - flake8##########
1,1,F,F821:undefined name 'path'
##########Linting Output - mypy##########
subdir/temp.py:1: error: Name 'path' is not defined
Found 1 error in 1 file (checked 1 source file)
ayroblu commented 4 years ago

I retried this again, looks like it works now, (different test, might be a limitation of mpls), not sure what happened

ayroblu commented 4 years ago

Confirmed, looks like a limitation of MPLS that it's only for first party, third party (not builtins)