0x4ndy
0x4ndy

Reputation: 1346

nvim with coc and formatting for python

I've been trying to move to nvim as my code editor, but I've been having issues with using the code formatting. For now I want to set it up for python and every time I tried to perform a format operation, I get the following error:

[coc.nvim]: UnhandledRejection: request error nvim_call_function - Vim:E117: Unknown function: coc#util#echo_line
Error
    at wF.request (/home/andy/.config/nvim/autoload/plugged/coc.nvim/build/index.js:30:34430)
    at wF.call (/home/andy/.config/nvim/autoload/plugged/coc.nvim/build/index.js:33:3671)
    at Timeout._onTimeout (/home/andy/.config/coc/extensions/node_modules/coc-python/lib/index.js:123358:39)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7)
Press ENTER or type command to continue

Here is my set up: nvim

NVIM v0.5.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az242-526

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

npm

6.14.15

node

v14.17.6

coc-settings.json

{
  "coc.preferences.formatOnSaveFiletypes": ["css", "markdown", "javascript", "graphql", "html", "yaml",  "json", "python"],

  // python config
  "python.linting.enabled": true,
  "python.linting.pylintEnabled": true,
  "python.formatting.provider": "yapf",

  "snippets.ultisnips.directories":
  [
    "UltiSnips",
    "~/.config/nvim/utils/snips"
  ]

}

Upvotes: 1

Views: 5943

Answers (1)

fannheyward
fannheyward

Reputation: 19287

The error is came from coc-python, but coc-python is deprecated, https://github.com/neoclide/coc-python#coc-python, try coc-pyright or coc-jedi.

Upvotes: 4

Related Questions