Giter Site home page Giter Site logo

coc-python's Introduction

Neoclide

Neoclide is a rework of Nyaovim, the reason is I want it have best user experience.

Neoclide is an editor built with web technologies while emebed with neovim.

Neoclide is in early development, which means it could break easily, and you should not take it seriously.

Since I use Mac only, something could break on other platform, I need your help!

What have done

  • Global session save and restore
  • Fixed copy/paste behaviour
  • Fixed drag and click position calculate
  • Fixed trigger of VimLeave event
  • Background transparent support
  • Improved input method support
  • Improved cursor support
  • Accessable editor state object
  • Automatic resize handler, no screen blink

How to use

Since it's in early age, no prebuild currently avaiable, you have to use it from souce code.

  • Clone this repository

  • Run following commands to install dependencies and build code

    npm run dep
    npm run build
    
  • To start the app, use:

    npm run app
    

LICENSE

Copyright 2016 [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

coc-python's People

Contributors

alexd2580 avatar braun-steven avatar burninglutz avatar ccoolsnake avatar chemzqm avatar hoov avatar jesperrix avatar mrparalon avatar randrej avatar theangryangel avatar voldikss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coc-python's Issues

[solved] can not make coc-python auto-completion work with Jedi

Update: it seems that the problem is due to that Jedi package is not in the latest version, although I don not understand why.

problem description

I tried to install coc.nvim and coc-python extension on two machines: Mac and Linux. On Mac, it works as expected after install. But on Linux, I can not make the completion work.

My environment

  • Mac: mac os mojave
  • Linux: CentOS 7.4
  • Neovim: 0.4.0
  • Python: Python 3.5+ (bundled with Anaconda)
  • Jedi

steps I have tried

Here is what I do

  1. Install Nodejs (I have installed a binary version of nodejs since I do not have root rights) and set its path correctly.

  2. Install yarn via the script provided in the coc.nvim readme. I can call yarn on the command line

  3. Install coc.nvim via vim-plug

  4. Install coc-python via the command :CocInstall coc-python. (It seems that coc-python supports both Jedi and MPLS and Jedi is used by default. I have already installed Jedi.)

On my Mac, this is all I do to make the auto-completion work for Python file.
But on Linux, it does not work.

Steps further tried on Linux

I run the :checkhealth command inside neovim and found some error related to coc.nvim and nodejs. For coc.nvim, it shows that :pyx does not work. All it prompted me to use :call coc#util#build() command. For nodejs, the warning is that neovim is not installed.

I add set pyxversion=3 to my config and run the command :call coc#util#build() and the build is successful.

I also installed neovim module via

yarn global add neovim

After all these steps, :checkhealth shows no errors or warnings related to coc.nvim

health#coc#check
========================================================================
  - OK: Environment check passed

  - OK: Build javascript found
  - OK: Service started

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: RelWithDebInfo

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

health#provider#check
========================================================================
## Clipboard (optional)
  - WARNING: No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work.
    - ADVICE:
      - :help clipboard

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /bin/python2 does not have the "neovim" module. :help provider-python
          /bin/python2.7 does not have the "neovim" module. :help provider-python
          python2.6 not found in search path or not executable.
          /home/haojiedong/tools/anaconda3/bin/python is Python 3.6 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /home/haojiedong/tools/anaconda3/bin/python3
  - INFO: Python version: 3.6.5
  - INFO: pynvim version: 0.3.2
  - OK: Latest pynvim is installed.

## Ruby provider (optional)
  - WARNING: `ruby` and `gem` must be in $PATH.
    - ADVICE:
      - Install Ruby and verify that `ruby` and `gem` commands work.

## Node.js provider (optional)
  - INFO: Node.js: v10.15.3
  - INFO: Neovim node.js host: /home/haojiedong/.config/yarn/global//node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn package is installed: 4.5.0

After that, I open a python file and auto-completion still does not work for packages and modules. Any idea, what should I try next?

what works

It should be noted that completion for words inside the buffer works:

image

But auto-completion for packages does not work:

image

I also tried to see if auto-completion for viml works by installing the following plugin:

Plug 'Shougo/neco-vim'
Plug 'neoclide/coc-neco'

Auto-completion does work for vim script as shown below

image

So it seems that coc.nvim works. The issue may be in coc-python. Currently, I only add the following config to my coc-settings.json file:

{
"suggest.timeout": 5000
}

( On my Mac, I can use python auto-completion without setting anything inside this file. )

I have also tried to remove coc.nvim and re-install from scratch. But it does not solve the problem either.

My minimal non-working config

Here is my minimal non-working config:

call plug#begin(expand('~/.local/share/nvim/plugged'))
Plug 'neoclide/coc.nvim', {'do': './install.sh'}
Plug 'Shougo/neco-vim'
Plug 'neoclide/coc-neco'
call plug#end()

set pyxversion=3

Follow up

After all these step, I tried to update jedi:

conda update jedi

Now the auto-completion finally works! Maybe it is caused by Jedi? But if I use deoplete and deoplete-jedi for auto-completion, there is no such issue.

I not sure why updating to latest Jedi solves this issue. Does coc-python depends on some specific features from the latest version of Jedi? Maybe there should be a warning message about the Jedi is not in the latest version when using :checkhealth.

Way to disable MLPS linter, python.analysis?

When MLPS is turned on (jedi enabled = False) and the linters are off, it still seems to 'lint' through the python.analysis thing of MLPS (I think it is). Please see below (the messages of the 'linter' overlap with the code below). Is there a way to turn that off?

Screen Shot 2019-03-28 at 10 54 27 AM

I tried the following in coc-settings but it doesn't seem to help:

"python.jediEnabled": false,
"python.analysis.logLevel": "Fatal",
"python.analysis.errors": ["undefined-variable"],
"python.analysis.errors": ["undefined-variable"],
"python.analysis.information": ["undefined-variable"],
"python.linting.enabled": false,

RuntimeError: location not created nor specified'. Make sure pipenv is on the PATH.

你好,我只是简单的打开了一个脚本,当前目录下也没有pipfile这个文件,但是messages里面报这个错误。

[coc.nvim] Workspace contains pipfile but attempt to run 'pipenv --venv' failed with 'Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>                                                                                                                                                     
    sys.exit(cli())
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 105, in augment_usage_errors
    yield
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 105, in augment_usage_errors
    yield
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pipenv/cli/command.py", line 136, in cli
    do_py()
  File "/usr/local/lib/python3.5/dist-packages/pipenv/core.py", line 1640, in do_py
    click.echo(which("python", allow_global=system))
  File "/usr/local/lib/python3.5/dist-packages/pipenv/core.py", line 114, in which
    raise RuntimeError("location not created nor specified")
RuntimeError: location not created nor specified'. Make sure pipenv is on the PATH.

Improper Jedi environment initialization prevents older Jedi versions from working

Sometimes you want to use an older version of Jedi in a virtualenv with coc-python, because PyQT5 / PySide2 don't work with Jedi versions >12.1.

Here's the Jedi issue that outlines what happens: davidhalter/jedi#1287.

So, until they fix that, people who work with PyQT5 / PySide2 have to use jedi = "0.12.1".
But that doesn't work with coc-python because the code in this project (forked from the vscode plugin) initializes the jedi environment the wrong way:

    def __init__(self):
        self.default_sys_path = sys.path
        self.environment = jedi.api.environment.Environment(sys.executable)

which is clearly against the recommendation in the Jedi project

class Environment(_BaseEnvironment):
    """
    This class is supposed to be created by internal Jedi architecture. You
    should not create it directly. Please use create_environment or the other
    functions instead. It is then returned by that function.
    """

This, coupled with an API change in Jedi, renders coc-python unable to interface with the legacy Jedi version, since jedi.api.environment.Environment constructor's arguments have changed in the meantime.

But, if we use the recommended way of creating the environment, jedi.api.environment.Environment, the issue goes away and coc-python works properly with both jedi = "0.12.1" and jedi = "0.13.3" (latest).

This is the change:

    def __init__(self):
        self.default_sys_path = sys.path
        self.environment = jedi.api.environment.create_environment(
            sys.executable, safe=False
        )

I'll put up a pull request with this fix right away.

Selecting flake8 each time and Python2

I have no pylint installed - just flake8.
Each time I open .py file I get a question:

Linter pylint is not installed.:
1. Install
2. Select linter
3. Do not show again

I select 2. and then I check flake8.
It looks like it never works and the choice is not saved.
I added in my ~/.config/nvim/coc-settings.json:

{
  "python.setInterpreter": "python2",
  "python.setLinter": "flake8"
}

And still it does not help. Python version is also choosen inproper (Python3 instead of Python2)

And moreover, how to always show the linter results?

Timeout

While trying to use completion:
[coc.nvim] source python timeout after 5000ms

Also cpu usage is 100%
Снимок экрана 2019-04-11 в 15 26 21

My coc-settings.json:

{
	"diagnostic.errorSign": " ",
	"diagnostic.warningSign": " ",
	"diagnostic.infoSign": " ",
	"diagnostic.hintSign": "",
	"suggest.timeout": 5000,
	"python.jediEnabled": false,
	"python.linting.flake8Path": "/usr/local/bin/flake8",
	"python.linting.flake8Enabled": true,
	"python.autoComplete.addBrackets": true,
	"python.linting.enabled": true,
	"languageserver": {
		"bash": {
		      "command": "bash-language-server",
		      "args": ["start"],
		      "filetypes": ["sh"],
		      "ignoredRootPaths": ["~"]
		},
	},
}

I'm using master:
Plug 'neoclide/coc.nvim', { 'do': 'yarn install --frozen-lockfile'}

Unresolved import

Hello. I got a problem when having the following CocConfig:

{
    "suggest.enablePreview": true,
    "python.jediEnabled": false,
    "python.linting.flake8Enabled": true,
    "python.linting.pylintEnabled": false,
    "suggest.timeout": 5000
}

I got en error that I have an unresolved import. I think this may be a problem with MLPS? But in VS code I don't get this error:
Screenshot 2019-04-02 at 16 19 01
This also makes so I don't get suggestions for gym_minigrid. Enabling Jedi get rid of the error but the suggestions still won't work. Any suggestions?

Fixer

Coc-python is a really tool to lint but is there a way to use it as a fixer ?

autocomplete with underscore doesn't work

It seems that using the _ character renders autocomplete options invalid. For instance, see below (using MPLS, might be on jedi too).

These are the options:

Screen Shot 2019-04-02 at 12 26 29 PM

Now with the _ it doesnt show the options anymore:

Screen Shot 2019-04-02 at 12 26 56 PM

Is there a reason for this / can this be fixed? Would be great!

Skipping the _ does show the options, some of them, through fuzzy matching:

Screen Shot 2019-04-02 at 12 26 49 PM

linter not disabled?

I tried to disable the lint function but it doesn't seem to respect the coc-settings.json? it looks as follows

{
"coc.preferences.timeout": 5000,
"python.jediEnabled": false,
"python.linting.enabled"; false,
}

But still seems to lint:

Screen Shot 2019-03-27 at 3 57 58 PM

Thanks again!

"Formatting with yapf" message shown after formatting

When calling ":Format" on a buffer coc-python shows the status message

[coc.nvim] Formatting with yapf

This message is kept shown in the status line even after formatting is done. I would expect this message to be hidden after formatting or at least being replaced by a success message.

Linter messages not always visible

After starting neovim with current version of coc+coc-python I always get the correct information from the linter, can cycle through the messages with coc-diagnostic-next and get the detail message in the popup next to the cursor.

From time to time the popup does not work anymore and I have no chance to see the detail message of the linter. The icons on the side of the lines are correctly created. And the messages are visible with ":CocCommand python.viewOutput".

a) Would love to have this working without issues.
b) In case it is not easy fixable, would it be possible to show the message in the command-line?

Is there anything needed I can send you to help?

Should MPLS update automatically?

python.autoUpdateLanguageServer is set to true by default in the extension. However, it won't update automatically. I have been removing the language server download at ~/.config/coc/extensions/coc-python-data/languageServer.x.x.xx manually for whatever version is installed and the current version will then download.

ENOENT error Unhandle Rejection

Hello,

Fantastic that you made this! Just ran the CoC Install, and got this error, do you know how to fix this?Thanks!

extension coc-python installed!
[coc.nvim] Error loading extension from /Users/admin/.config/coc/extensions/node_modules/coc-python/lib/index.js: (intermediate value).disable(...).ignoreErrors is not a function
[vim-node-coc]: UnhandledRejection: ENOENT: no such file or directory, rename '/Users/admin/.config/coc/extensions/node_modules/coc-python/out/client/debugger/debugAdapter/main.js.map' -> '/Users/admin/.c
onfig/coc/extensions/node_modules/coc-python/out/client/debugger/debugAdapter/main.js.map.disabled'
Error: ENOENT: no such file or directory, rename '/Users/admin/.config/coc/extensions/node_modules/coc-python/out/client/debugger/debugAdapter/main.js.map' -> '/Users/admin/.config/coc/extensions/node_mod
ules/coc-python/out/client/debugger/debugAdapter/main.js.map.disabled'
[coc.nvim] Extension coc-python not found!
[coc.nvim] Extension coc-python not found!
extension coc-python installed!
[coc.nvim] Error loading extension from /Users/admin/.config/coc/extensions/node_modules/coc-python/lib/index.js: (intermediate value).disable(...).ignoreErrors is not a function
[vim-node-coc]: UnhandledRejection: ENOENT: no such file or directory, rename '/Users/admin/.config/coc/extensions/node_modules/coc-python/lib/index.js.map' -> '/Users/admin/.config/coc/extensions/node_mo
dules/coc-python/lib/index.js.map.disabled'
Error: ENOENT: no such file or directory, rename '/Users/admin/.config/coc/extensions/node_modules/coc-python/lib/index.js.map' -> '/Users/admin/.config/coc/extensions/node_modules/coc-python/lib/index.js
.map.disabled'

Error when writing buffer to disk

When saving a buffer to disk, it throws the following error in CocInfo. It only seems to happen with python files. Latest cog-python is installed. Any clue?

## versions

vim version: NVIM v0.4.0-dev
node version: v10.15.3
coc.nvim version: 0.0.67
term: iTerm.app
platform: darwin

## Error messagesUncaught exception: TypeError: Cannot read property 'remove' of undefined
    at Object.dispose (/Users/me/.config/coc/extensions/node_modules/vscode-jsonrpc/lib/events.js:99:41)
    at disposables.forEach.disposable (/Users/me/.config/coc/extensions/node_modules/coc-python/lib/common/process/proc.js:131:58)
    at Array.forEach (<anonymous>)
    at ChildProcess.proc.once (/Users/me/.config/coc/extensions/node_modules/coc-python/lib/common/process/proc.js:131:25)
    at Object.onceWrapper (events.js:277:13)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)

## Output channel: Python
Starting Jedi Python language engine.
##########Linting Output - pylint##########
************* Module capacity_main
408,0,refactor,too-many-branches:Too many branches (23/12)
408,0,refactor,too-many-statements:Too many statements (125/50)

------------------------------------------------------------------
Your code has been rated at 9.93/10 (previous run: 9.93/10, +0.00)

Minimal Init.vim

set shell=bash

filetype off

call plug#begin('~/.local/share/nvim/plugged')

Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}}

call plug#end()

" We have to turn this stuff back on if we want all of our features.
filetype plugin indent on " Filetype auto-detection
syntax on " Syntax highlighting

let g:python3_host_prog = expand('~/anaconda3/bin/python')
" let g:loaded_python_provider = 1 " disable python2 support
let g:python_host_prog = expand('~/anaconda3/envs/staffing/bin/python')

check health from Neovim

health#coc#check
========================================================================
  - OK: Environment check passed

  - OK: Build javascript found
  - OK: Service started

Debug [coc.nvim] source jedi timeout after 5000ms

When input im in a *.py, I get [coc.nvim] source jedi timeout after 5000ms. I cannot get any completion from JD (jedi). MPLS also times out for me. I am not sure what happens. The same configuration file works on another machine. Below is my coc-settings.json:

   "suggest.timeout":  5000,
   "diagnostic.checkCurrentLine": true,
   "emmet.includeLanguages": {"markdown": "html"},
   "emmet.excludeLanguages": [],
   "python.jediEnabled": true,
   "list.normalMappings": {
       "<C-c>": "do:exit"
   },
   "list.insertMappings": {
       "<C-c>": "do:exit"
   },
   "languageserver": {
       "ccls": {
           "command": "ccls",
           "filetypes": ["c", "cpp", "objc", "objcpp"],
           "rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
           "initializationOptions": {
               "cache": {
                   "directory": "/tmp/ccls"
               }
           }
       }
   }
}

Don't automatically put python.pythonPath into coc-settings.json

Hi chemzqm, first of all thank you so much for coc.nvim. It's improved my entire vim experience.

Here's my issue:

I work on a bunch of different python projects — some have their own virtual environment, some just work in the global/system Python space. One project specifically causes coc to automatically add this line into coc-settings.json:

"python.pythonPath": ".venv/bin/python3"

The problem is that venv path is not universal for all my projects, and once that line has been added to coc-settings.json, it causes my other projects with different python paths to pop up the No Python interpreter is selected prompt.

Is there a way to prevent automatically writing python.pythonPath into the config file, and just use the current python that exists in $PATH?

Interpreter keep switching to global one

I'm using this minimal vimrc

set runtimepath+=~/.vim
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'do': 'yarn install'}
Plug 'honza/vim-snippets'
call plug#end()
let g:coc_snippet_next = '<TAB>'
let g:coc_snippet_prev = '<S-TAB>'
 let g:coc_global_extensions =['coc-snippets','coc-json']
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"

Starting it inside a virtualenv called "buxbot" and vi -u mini.vim
Running :CocCommand -> Select Interpreter

Select pythonPath, current: /usr/local/opt/python/bin/python3.7:
1. /usr/bin/python
2. /usr/local/bin/python
3. /usr/local/opt/python@2/bin/python2.7
4. /Users/user/.virtualenvs/buxbot/bin/python
5. /usr/local/bin/python3

After choosing 4 and run CocCommand again,

Select pythonPath, current: /usr/local/opt/python/bin/python3.7:

Also I think it should choose the current python (which is the virtualenv) by default.

I'm using NVIM v0.3.4 on MacOS

Error output from python: Starting client failed:

Thank you for share this wonderful program :)

I moved from coc and coc-pyls.
I reinstalled coc too! but It occur error. I have no idea what's wrong. Please help!

Here is my env

  • OS: ubuntu x64 18.x.x LTS
  • Node version: 10.15.3 (installed by NVM)
  • Yarn version: 1.15.2
  • vim-plug Plug 'neoclide/coc.nvim', { 'do': 'yarn install --frozen-lockfile'}
  • output of CocList extensions:
  1 + coc-json 1.0.12 ~/.config/coc/extensions/node_modules/coc-json
  2 + coc-python 1.0.4 ~/.config/coc/extensions/node_modules/coc-python
  3 + coc-vetur 1.1.0 ~/.config/coc/extensions/node_modules/coc-vetur

And this is screen shot
coc-python 제보

Here is outpt of :CocOpenLog

705 2019-03-27T15:58:33.392 INFO (pid:15097) [extension-coc-python] - Python Extension: Interpreters returned by WorkspaceVirtualEnvService are of count 0
706 2019-03-27T15:58:33.393 INFO (pid:15097) [extension-coc-python] - Python Extension: Get language server folder name, Class name = LanguageServerFolderService, , Return Value: "languageServer.0.2.31"
707 2019-03-27T15:58:33.395 INFO (pid:15097) [extension-coc-python] - Python Extension: Cached data exists getEnvironmentVariables, /home/the1900/repo/erp_joyfulworks_api/manage.py
708 2019-03-27T15:58:33.400 INFO (pid:15097) [extension-coc-python] - Python Extension: Interpreters returned by VirtualEnvService are of count 3
709 2019-03-27T15:58:33.405 INFO (pid:15097) [extension-coc-python] - Python Extension: Interpreters returned by CurrentPathService are of count 5
710 2019-03-27T15:58:33.406 INFO (pid:15097) [extension-coc-python] - Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
711 2019-03-27T15:58:33.409 ERROR (pid:15097) [extension-coc-python] - Python Extension: getActivatedEnvironmentVariables TypeError: scriptFile.fileToCommandArgument is not a function
712   ¦ at Bash.<anonymous> (/home/the1900/.config/coc/extensions/node_modules/coc-python/lib/common/terminal/environmentActivationProviders/bash.js:31:42)
713   ¦ at Generator.next (<anonymous>)
714   ¦ at fulfilled (/home/the1900/.config/coc/extensions/node_modules/tslib/tslib.js:104:62)
715 2019-03-27T15:58:33.410 INFO (pid:15097) [extension-coc-python] - Python Extension: getActivatedEnvironmentVariables, Class name = EnvironmentActivationService, Arg 1: <Uri:/home/the1900/repo/erp_joyfulworks_api/manage.py>
716 2019-03-27T15:58:33.410 INFO (pid:15097) [extension-coc-python] - Python Extension: Cached data exists getEnvironmentVariables, /home/the1900/repo/erp_joyfulworks_api/manage.py
717 2019-03-27T15:58:33.411 INFO (pid:15097) [extension-coc-python] - Python Extension: Get language server folder name, Class name = LanguageServerFolderService, , Return Value: "languageServer.0.2.31"
718 2019-03-27T15:58:33.421 ERROR (pid:15097) [server] - uncaughtException Error: spawn /home/the1900/.config/coc/extensions/coc-python-data/languageServer.0.2.31/Microsoft.Python.LanguageServer EACCES
719   ¦ at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
720   ¦ at onErrorNT (internal/child_process.js:415:16)
721   ¦ at process._tickCallback (internal/process/next_tick.js:63:19)
722 2019-03-27T15:58:33.422 ERROR (pid:15097) [server] - unhandledRejection  Promise {
723   <rejected> Error: Launching server using command /home/the1900/.config/coc/extensions/coc-python-data/languageServer.0.2.31/Microsoft.Python.LanguageServer failed.
724   ¦ ¦ at LanguageClient.createMessageTransports (/home/the1900/.local/share/nvim/plugged/coc.nvim/lib/language-client/index.js:343:23) } Error: Launching server using command /home/the1900/.config/coc/extensions/coc-python-data/lang
725   ¦ at LanguageClient.createMessageTransports (/home/the1900/.local/share/nvim/plugged/coc.nvim/lib/language-client/index.js:343:23)
726 2019-03-27T15:58:33.564 INFO (pid:15097) [extension-coc-python] - Python Extension: Interpreters returned by PipEnvService are of count 1
727 2019-03-27T15:58:33.564 INFO (pid:15097) [extension-coc-python] - Python Extension: Checking whether locactors have completed locating, Class name = InterpreterLocatorProgressService, , Return Value: false
728 2019-03-27T15:58:33.564 INFO (pid:15097) [extension-coc-python] - Python Extension: Checking whether locactors have completed locating, Class name = InterpreterLocatorProgressService, , Return Value: false
729 2019-03-27T15:58:33.564 INFO (pid:15097) [extension-coc-python] - Python Extension: Checking whether locactors have completed locating, Class name = InterpreterLocatorProgressService, , Return Value: false

Prospector with empty output

I have a problem using coc-python with prospector.
I don't have any output with prospector when a use a specific configuration:

{
"diagnostic.refreshOnInsertMode": true,
"suggest.enablePreview": false,
"coc.preferences.formatOnSaveFiletypes": ["python"],
"diagnostic.joinMessageLines":true,
"diagnostic.checkCurrentLine":true,
"diagnostic.warningSign":"",
"diagnostic.errorSign": "",
"diagnostic.infoSign": "",
"diagnostic.hintSign": "",
"diagnostic.displayByAle": false,
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.jediEnabled": true,
"python.linting.pylintEnabled": false,
"python.linting.prospectorEnabled": true,
"python.linting.prospectorArgs": ["--profile --my_own_profile","-D"],
"python.linting.pydocstyleEnabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length 119"],
"python.linting.banditEnabled": true,
"list.source.tags.command": "ctags -R ."
}

I already try put "python.linting.prospectorArgs": ["--profile","my_own_profile","-D"], but I think that two syntax don't have difference between.

python.output:

Starting Jedi Python language engine.
##########Linting Output - pydocstyle##########
/home/felipemarcelino/documents/main/fun_lo.py:1 at module level:
D100: Missing docstring in public module
/home/felipemarcelino/documents/main/fun_lo.py:1 in public function teste:
D103: Missing docstring in public function
/home/felipemarcelino/documents/main/fun_lo.py:5 in public function sfd:
D103: Missing docstring in public function
/home/felipemarcelino/documents/main/fun_lo.py:9 in public class class_b:
D101: Missing docstring in public class
##########Linting Output - bandit##########
##########Linting Output - prospector##########
##########Linting Output - prospector##########
##########Linting Output - pydocstyle##########
/home/felipemarcelino/documents/main/fun_lo.py:1 at module level:
D100: Missing docstring in public module
/home/felipemarcelino/documents/main/fun_lo.py:1 in public function teste:
D103: Missing docstring in public function
/home/felipemarcelino/documents/main/fun_lo.py:5 in public function sfd:
D103: Missing docstring in public function
/home/felipemarcelino/documents/main/fun_lo.py:9 in public class class_b:
D101: Missing docstring in public class
##########Linting Output - bandit##########
##########Linting Output - prospector##########
##########Linting Output - prospector##########

*** EDIT 1***

I changed to
"python.linting.prospectorArgs": ["--profile", "my_own_profile","-D"],
and python output with some errors and warnings, but this don't populate my floating window and neither my column sign.

*** EDIT 2***

Works when I remove prospector args, but not with my edited profile config! The two cases with profile and without profile have output, but only the last one is populate in file by coc!

Error on write

If a save a python file (unfortunately cannot share) two times in a row with :w I get the error in screenshot:
2019-05-29-115136_1920x1080_scrot

If you really need it I can try reproducing the issue in a public file.

python.autoComplete.extraPaths: Inconsistent path expansion

Different paths like python.linting.pylintPath are supporting tilde (home path) expansion internally, but the paths given in python.autoComplete.extraPaths are not expanded. Haven't tested, but python.autoComplete.typeshedPaths may also be affected by this.

In the moment I use something like this I in the coc-settings.json the path is not used correctly:

"python.autoComplete.extraPaths": ["~/git/test"],

This works as expected:

"python.autoComplete.extraPaths": ["/home/lm/git/test"],

Using ${workspaceFolder} also works as expected

"python.autoComplete.extraPaths": ["${workspaceFolder}/test"],

Function signature snippet not working

In the deprecated python extension coc-pyls, autocompletion of a function resulted in a snippet where it was possible to jump between the prefilled function arguments. I have not been able to reproduce this behavior, nor with jedi neither with MLPS. Is there any further configuration needed or will this not be supported by this extension?

Change jedi source shortcut?

It seems like the shortcut for jedi is hardcoded to JD. Is there a way to change this? setting jedi.shortcut or coc.source.jedi.shortcut don't seem to work.

virtualenv problem

1.So, I create virtualenv, select it in coccomand menu. But it doesn't see the virtualenv, intellisense and go to definition do not work.
2. But if I create virtualenv with --system-site-packages and choose it in coccomandmenu, then everything works.
After a little bit of searching I found that coc-python uses jedi, which I need to pip install in each virtualenv. Or use --system-site-packages flag. Does someone know more elegant way of dealing with it?
Microsoft python language server does not work, btw

linter turned off when python.jediEnabled is set to false

Putting

"python.jediEnabled": false

in coc-settings.json (to enable Intellisense, since it is disabled by default in favor of jedi) seems to disable the linter, even when

"python.linting.enabled": true,
"python.linting.pylintEnabled": true,

are in coc-settings.json as well.

A similar problem for vscode itself is reported here:

microsoft/vscode-python#3292

Do you know whether this is fixable for coc-python?

Thanks again!

Extension fails to install on latest coc.nvim

Environment

  • NVIM v0.3.4
  • macOS Mojave 10.14.4 (18E226)
  • Node.js version in $PATH: v11.11.0
  • Commit (coc.nvim): 99789bb016cefd3730535ed7a211c600b4cc8772
  • Branch: master

Description

I'm running into an issue where the coc-python extension fails to install with the following statusline error:

[coc.nvim] Error loading extension from /Users/eyalkalderon/.config/coc/extensions/node_modules/coc-python/lib/index.js: Reflect.hasOwnMetadata is not a function

I've already removed the 'tag': '*' from the relevant Plug command in my init.vim and have upgraded my coc.nvim to the latest master, as suggested here. Any idea what could be going wrong?

Formatting problems

Hi,

I am not able to use formatting (with black) with this extension. I'm getting Error on 'format': undefined errors when using :call CocAction('format') or :call CocAction('format', @%).

Can you provide documentation how to format the whole buffer using this extension?

Thanks

[file].py.[hash].py temporary files confuse pytest

There are some cases where files with the name scheme [file].py.[hash].py are left on the disk in my project directory. Looks like temporary files that are not cleaned up in all cases.

This makes e.g. my pytest unit tests fail with an error like this:

ImportError: No module named py.b4589e12220d89ad8ac6d192d7ad9a25

I think the files should use another naming scheme which does not confuse common workflows. I guess that making them not end with ".py" would be a good start.

yarn error

Getting a yarn pkg error here, when trying:

:CocInstall coc-python

Do you know if it's already on there? Thanks for this, very exciting!

Not using the python in PATH

My coc-settings.json has no python settings at all (i.e. it's a blank slate), and my virtualenv is activated (in other words $VIRTUAL_ENV has a value).

Despite this, it's showing every sign of not properly identifying the virtualenv python path:

  • Throwing "unresolved-import" warnings on packages that are definitely installed in the virtualenv
  • Unable to auto-complete on packages that are definitely installed

As an example, from within the python shell I can run from django.db import models, but then immediately opening neovim, with a file that contains that line, throws an "unresolved-import".

Here's a quick GIF showing the issue:

coc-problems

Out of the range or missing libcuda.so.1

It broken when open file.

## versions

vim version: NVIM v0.4.0-420-g29d6993cc
node version: v11.12.0
coc.nvim version: 0.0.62
term: screen-256color
platform: linux

## Error messages
UnhandledRejection: Specified argument was out of the range of valid values.
Error: Specified argument was out of the range of valid values.
    at handleResponse (/home/lijie/.vim/plugged/coc.nvim/node_modules/vscode-jsonrpc/lib/main.js:436:48)
    at processMessageQueue (/home/lijie/.vim/plugged/coc.nvim/node_modules/vscode-jsonrpc/lib/main.js:263:17)
    at Immediate.setImmediate (/home/lijie/.vim/plugged/coc.nvim/node_modules/vscode-jsonrpc/lib/main.js:247:13)
    at processImmediate (timers.js:638:19)
## Output channel: snippets

## Output channel: Python
Starting Microsoft Python language server.
[Info  - 11:04:00 PM] GetCurrentSearchPaths /home/lijie/.pyenv/shims/python 
[Info  - 11:04:00 PM] Python search paths:
[Info  - 11:04:00 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7
[Info  - 11:04:00 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7/lib-dynload
[Info  - 11:04:00 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7/site-packages
[Info  - 11:04:00 PM] Configuration search paths:
[Error  - 11:04:00 PM] Server initialization failed.
  Message: Specified argument was out of the range of valid values.
  Code: -32000 
   at System.ReadOnlySpan`1..ctor(Void* pointer, Int32 length)
   at Interop.Sys.DirectoryEntry.GetName(Span`1 buffer)
   at System.IO.Enumeration.FileSystemEntry.get_FileName()
   at System.IO.Enumeration.FileSystemEnumerableFactory.<>c__DisplayClass3_0.<UserFiles>b__1(FileSystemEntry& entry)
   at System.IO.Enumeration.FileSystemEnumerable`1.DelegateEnumerator.ShouldIncludeEntry(FileSystemEntry& entry)
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.Python.Core.IO.PathUtils.EnumerateFiles(String root, String pattern, Boolean recurse, Boolean fullPaths)+MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at Microsoft.Python.Analysis.Modules.Resolution.ModuleResolutionBase.ReloadModulePaths(IEnumerable`1& rootPaths)
   at Microsoft.Python.Analysis.Modules.Resolution.MainModuleResolution.ReloadAsync(CancellationToken cancellationToken)
   at Microsoft.Python.Analysis.Modules.Resolution.MainModuleResolution.InitializeAsync(CancellationToken cancellationToken)
   at Microsoft.Python.Analysis.Analyzer.PythonInterpreter.LoadBuiltinTypesAsync(String root, IServiceManager sm, CancellationToken cancellationToken)
   at Microsoft.Python.Analysis.Analyzer.PythonInterpreter.CreateAsync(InterpreterConfiguration configuration, String root, IServiceManager sm, CancellationToken cancellationToken)
   at Microsoft.Python.LanguageServer.Implementation.Server.InitializeAsync(InitializeParams params, CancellationToken cancellationToken)
   at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Initialize(JToken token, CancellationToken cancellationToken)

I try another project, the error differs. I install pytorch along with tensorflow-cpu, and no nvidia card is on my PC.

## versions

vim version: NVIM v0.4.0-420-g29d6993cc
node version: v11.12.0
coc.nvim version: 0.0.62
term: screen-256color
platform: linux

## Error messages

## Output channel: snippets

## Output channel: Python
Starting Microsoft Python language server.
[Info  - 11:02:27 PM] GetCurrentSearchPaths /home/lijie/.pyenv/versions/3.7.1/bin/python 
[Info  - 11:02:27 PM] Python search paths:
[Info  - 11:02:27 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7
[Info  - 11:02:27 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7/lib-dynload
[Info  - 11:02:27 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7/site-packages
[Info  - 11:02:27 PM] Configuration search paths:
[Info  - 11:02:27 PM] Microsoft Python Language Server version 0.2.31.0
[Info  - 11:02:27 PM] Initializing for /home/lijie/.pyenv/versions/3.7.1/bin/python
Traceback (most recent call last):
  File "/home/lijie/.config/coc/extensions/coc-python-data/languageServer.0.2.31/scrape_module.py", line 1489, in <module>
    state.initial_import(sys.argv[2])
  File "/home/lijie/.config/coc/extensions/coc-python-data/languageServer.0.2.31/scrape_module.py", line 872, in initial_import
    mod = __import__(self.module_name)
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory
[Info  - 11:03:17 PM] GetCurrentSearchPaths /home/lijie/.pyenv/shims/python 
[Info  - 11:03:17 PM] Python search paths:
[Info  - 11:03:17 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7
[Info  - 11:03:17 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7/lib-dynload
[Info  - 11:03:17 PM]     /home/lijie/.pyenv/versions/3.7.1/lib/python3.7/site-packages
[Info  - 11:03:17 PM] Configuration search paths:
[Info  - 11:03:18 PM] Microsoft Python Language Server version 0.2.31.0
[Info  - 11:03:18 PM] Initializing for /home/lijie/.pyenv/shims/python
Traceback (most recent call last):
  File "/home/lijie/.config/coc/extensions/coc-python-data/languageServer.0.2.31/scrape_module.py", line 1489, in <module>
    state.initial_import(sys.argv[2])
  File "/home/lijie/.config/coc/extensions/coc-python-data/languageServer.0.2.31/scrape_module.py", line 872, in initial_import
    mod = __import__(self.module_name)
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

Thx

MPLS doesn't load .env correctly when another workspaceFolder exists

If no other workspace folders exist when a Python file is opened, MPLS
correctly loads the .env file. However if any other workspace folder exists,
MPLS fails to load the .env file. The current directory is still added to
CocList folders and the correct directory is watched by watchman.

To replicate this issue enable MPLS instead of Jedi and add a .env file with
something like PYTHONPATH=test/ in the appropriate location in the python
project. Open a file in the python project without any other workspaces open.
CocInfo should have a Configuration search paths: section under the python
output channel with the correct path. In a new instance of vim/nvim open some
other workspace and then open a python file. While everything else will work
correctly, the Configuration search paths: section will be empty and the
language server won't search the additional paths.

How to use the refactoring features?

I have this mapping in my init.vim:

" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
xmap <leader>a  <Plug>(coc-codeaction-selected)
nmap <leader>a  <Plug>(coc-codeaction-selected)

But when I select some lines and press <leader>a, the only code action available is Sort imports, there are no extract variables and extract method code actions:
image

I can use the refactoring features fine in vscode.

Opening files renders errors

When opening files from Nerdtree, it gives these kind of errors in CocOpenLog, not sure whether it has to do with tabs/buffers and whether these need to be refreshed? When I open a file with :ex, I dont get these errors.

[Error - 9:35:39 PM] Unable to find document file:///Users/admin/Dropbox/FinalCrawUbu/website/github/progSpyder/00000000_stface_rec.py
[Error - 9:35:40 PM] Unable to find document file:///Users/admin/Dropbox/FinalCrawUbu/website/github/progSpyder/00000000_stface_rec.py
[Error - 9:37:21 PM] Request textDocument/completion failed.
Message: name
Code: -32000
at Microsoft.Python.Analysis.Values.VariableCollection.DeclareVariable(String name, IMember value, VariableSource source, LocationInfo location)
at Microsoft.Python.Analysis.Analyzer.Evaluation.ExpressionEval.DeclareVariable(String name, IMember value, VariableSource source, LocationInfo location, Boolean overwrite)
at Microsoft.Python.Analysis.Analyzer.Handlers.ImportHandler.HandleImport(ModuleName moduleImportExpression, NameExpression asNameExpression, Boolean forceAbsolute)
at Microsoft.Python.Analysis.Analyzer.Handlers.ImportHandler.HandleImport(ImportStatement node)
at Microsoft.Python.Parsing.Ast.ImportStatement.Walk(PythonWalker walker)
at Microsoft.Python.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker)
at Microsoft.Python.Parsing.Ast.PythonAst.Walk(PythonWalker walker)
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.AnalyzeEntry(PythonAnalyzerEntry entry, IPythonModule module, PythonAst ast, Int32 version, CancellationToken cancellationToken)
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.Analyze(IDependencyChainNode1 node, IDependencyChainWalker2 walker, Stopwatch stopWatch, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerEntry.<>c.b__23_0(Task1 t) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.GetAnalysisAsync(PythonAnalyzerEntry entry, CancellationToken timeoutCt, CancellationToken cancellationToken)
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.GetAnalysisAsync(IPythonModule module, Int32 waitTime, CancellationToken cancellationToken)
at Microsoft.Python.LanguageServer.Implementation.Server.Completion(CompletionParams params, CancellationToken cancellationToken)
at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Completion(JToken token, CancellationToken cancellationToken)
[Error - 9:37:49 PM] Unable to find document file:///Users/admin/Dropbox/FinalCrawUbu/website/github/progSpyder/00000000_stface_rec.py

Master fails to compile

> yarn install --frozen-lockfile                                                                                                                                                                                 
yarn install v1.16.0
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] Validating package.json...
warning [email protected]: The engine "coc" appears to be invalid.
[2/5] Resolving packages...
warning @types/[email protected]: This is a stub types definition. del provides its own type definitions, so you do not need this installed.
warning webpack > micromatch > snapdragon > base > [email protected]: Critical bug fixed in v2.0.1, please upgrade to the latest version.
warning webpack > micromatch > snapdragon > base > cache-base > [email protected]: Critical bug fixed in v3.0.1, please upgrade to the latest version.
warning webpack > micromatch > snapdragon > base > cache-base > union-value > [email protected]: Critical bug fixed in v3.0.1, please upgrade to the latest version.
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...

$ npx npm-run-all clean build
npx: installed 58 in 1.471s
yarn run v1.16.0
warning [email protected]: The engine "coc" appears to be invalid.
$ rimraf lib
Done in 0.17s.
yarn run v1.16.0
warning [email protected]: The engine "coc" appears to be invalid.
$ webpack
Hash: b9e4006829e8b55c7f1b
Version: webpack 4.35.0
Time: 13238ms
Built at: 06/23/2019 12:58:03 PM
   Asset      Size  Chunks             Chunk Names
index.js  12.2 MiB       0  [emitted]  main
Entrypoint main = index.js
  [0] ./src/index.ts 11.8 KiB {0} [built]
  [2] external "coc.nvim" 42 bytes {0} [built]
 [73] ./src/activation/serviceRegistry.ts 5.1 KiB {0} [built]
 [75] ./src/common/types.ts 3.53 KiB {0} [built]
 [77] ./src/activation/types.ts 2.12 KiB {0} [built]
 [78] ./src/common/application/types.ts 519 bytes {0} [built]
 [83] ./src/application/types.ts 242 bytes {0} [built]
 [84] ./src/common/constants.ts 4.77 KiB {0} [built]
 [90] ./src/interpreter/contracts.ts 2 KiB {0} [built]
 [95] ./src/ioc/types.ts 315 bytes {0} [built]
[150] ./src/common/utils/async.ts 2.44 KiB {0} [built]
[165] ./src/common/utils/stopWatch.ts 412 bytes {0} [built]
[629] ./src/api.ts 662 bytes {0} [built]
[630] ./src/application/serviceRegistry.ts 623 bytes {0} [built]
[647] ./src/common/dotnet/serviceRegistry.ts 1.48 KiB {0} [built]
    + 847 hidden modules

ERROR in /home/kmoschcau/.local/share/nvim/plugged/coc-python/src/interpreter/locators/helpers.ts
./src/interpreter/locators/helpers.ts
[tsl] ERROR in /home/kmoschcau/.local/share/nvim/plugged/coc-python/src/interpreter/locators/helpers.ts(56,15)
      TS2322: Type 'string | boolean | Version | Architecture' is not assignable to type 'never'.
  Type 'string' is not assignable to type 'never'.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 2.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Initial reactions to using extension

I now have this extension installed and running.

These comments are not directed to the coc-python extension but rather the Microsoft Python Language Server which provides the functionality behind it.

It seems the Microsoft Python LanguageServer does not do asynchronous linting -- only on file save or if manually invoked.

Based on comments in the issues section of the Microsoft Python LanguageServer github repo, the latest version takes a long long time and lots of memory to do its initial source scan. While it is doing this, it is not availble for code completion. This seems to be new behavior -- there are a lot of complaints. On my system, for a small (150 lines) Python program which uses pandas and matplotlib, it takes about 2 minutes to become usable. When it does become ready code completion is quite good.

So, currently, I am running this extension with linting diabled so I am only using code completion.

I am using ALE for linting.

Bottom line...this extension seems to be working OK but the underlying language server has some issues.

coc-python has error on startup

I just did an update of coc.nvim and and a CocInstall of coc-python.

I am running vim 8.1

When I open a python file I get the following error:

2019-03-26T19:39:33.101 INFO (pid:12031) [plugin] - coc initialized with node: v8.9.0
2019-03-26T19:41:43.539 INFO (pid:12143) [services] - registed service "languageserver.ccls"
2019-03-26T19:41:43.625 ERROR (pid:12143) [util-factoroy] - TypeError: Reflect.hasOwnMetadata is not a function
at /home/dpriedel/.config/coc/extensions/node_modules/inversify/lib/annotation/injectable.js:7:21
at Object.__decorate (/home/dpriedel/.config/coc/extensions/node_modules/tslib/tslib.js:90:99)
at Object. (/home/dpriedel/.config/coc/extensions/node_modules/coc-python/lib/common/utils/random.js:25:18)
at Module._compile (/snapshot/coc.nvim/lib/util/factory.js:67:32)
at Object.Module._extensions..js (module.js:644:10)
at Module.load (module.js:552:32)
at tryModuleLoad (module.js:495:12)
at Function.Module._load (module.js:487:3)
at Module.require (module.js:577:17)
at Module.require (pkg/prelude/bootstrap.js:1159:31)
2019-03-26T19:41:43.652 INFO (pid:12143) [plugin] - coc initialized with node: v8.9.0

Thanks

coc-python hangs / high mem usage

Hello,

It seems to hang here:

versions

vim version: NVIM v0.4.0-dev
node version: v11.12.0
coc.nvim version: 0.0.62
term: undefined
platform: darwin

Error messages

Output channel: Python

~ │Starting Microsoft Python language serve
~ │r.
~ │[Info - 8:35:22 PM] GetCurrentSearchPat
~ │hs /usr/local/opt/python/bin/python3.6
~ │[Info - 8:35:22 PM] Python search paths
~ │:
~ │[Info - 8:35:22 PM] /private/var/fo
~ │lders/pm/6bbp0sh94_nc9qtfh6n5yp180000gq/
~ │T/aeswundx.4ek
~ │[Info - 8:35:22 PM] /usr/local/Cell
~ │ar/python/3.6.5/Frameworks/Python.framew
~ │ork/Versions/3.6/lib/python3.6
~ │[Info - 8:35:22 PM] /usr/local/Cell
~ │ar/python/3.6.5/Frameworks/Python.framew
~ │ork/Versions/3.6/lib/python3.6/lib-dynlo
~ │ad
~ │[Info - 8:35:22 PM] /usr/local/lib/
~ │python3.6/site-packages
~ │[Info - 8:35:22 PM] Configuration searc
~ │h paths:
~ │

It takes a few minutes to find the Configuration search paths, but often it crashes or the pc hangs before it does so. Is there a way to specify this manually or something? I can see the Python Language Server running in the background with like 50MB, and once it found the search paths it goes up to like 2GB.

Thanks!

Neomake error

:NeomakeInfo show me this error.
[coc.nvim] error: Uncaught exception: TypeError: Cannot read property 'remove' of undefined
at Object.dispose (/home/perilla/.config/coc/extensions/node_modules/vscode-jsonrpc/lib/events.js:99:41)
at disposables.forEach.disposable (/home/perilla/.config/coc/extensions/node_modules/coc-python/lib/common/process/proc.js:131:58)
at Array.forEach ()
at ChildProcess.proc.once (/home/perilla/.config/coc/extensions/node_modules/coc-python/lib/common/process/proc.js:131:25)
at Object.onceWrapper (events.js:273:13)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)

This error seems to be related with virtualtext option, because when I have errors on my
python file, I have virtualtext for each error when cursor is over the error, but when I fix
my error, virtualtext is not removed.

Console session recorded:
https://asciinema.org/a/PKcu5yDTSBkheCtBN2SM81ntE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.