Coc.nvim: [coc.nvim] Error on 'highlight': highlights is not iterable

Created on 13 Jan 2020  路  11Comments  路  Source: neoclide/coc.nvim

Screen Shot 2020-01-13 at 2 27 52 PM

I try to debug where this error comes from, any hints will be appreciated.

Can't reproduce

Most helpful comment

autocmd CursorHold * silent call CocActionAsync('highlight') together with coc-r-lsp caused it. But I am not sure how. I document here just in case others see the same problem

All 11 comments

autocmd CursorHold * silent call CocActionAsync('highlight') together with coc-r-lsp caused it. But I am not sure how. I document here just in case others see the same problem

Please provide a mini vimrc to reproduce this issue.

I do have the same problem.

Please paste content from :CocOpenLog

    1 2020-02-10T19:39:48.751 INFO (pid:95073) [services] - registered service "highlight"
    2 2020-02-10T19:39:48.971 INFO (pid:95073) [services] - registered service "r"
    3 2020-02-10T19:39:48.971 INFO (pid:95073) [services] - R Language Server state change: stopped => starting
    4 2020-02-10T19:39:49.000 INFO (pid:95073) [plugin] - coc 0.0.74-6700e7468d initialized with node: v13.8.0
    5 2020-02-10T19:39:49.014 INFO (pid:95073) [language-client-index] - highlight started with 95197
    6 2020-02-10T19:39:49.045 INFO (pid:95073) [language-client-index] - cSpell started with 95204
    7 2020-02-10T19:39:49.119 INFO (pid:95073) [services] - highlight server state change: starting => running
    8 2020-02-10T19:39:49.871 INFO (pid:95073) [services] - R Language Server state change: starting => running
    9 2020-02-10T19:39:49.875 INFO (pid:95073) [services] - service r started
   10 2020-02-10T19:39:50.335 ERROR (pid:95073) [plugin] - TypeError: highlights is not iterable
   11     at DocumentHighlighter.highlight (/home/yc/.cache/vim/dein/.cache/init.vim/.dein/build/index.js:65519:24)
   12     at async Handler.highlight (/home/yc/.cache/vim/dein/.cache/init.vim/.dein/build/index.js:64207:9)
   13     at async Plugin.cocAction (/home/yc/.cache/vim/dein/.cache/init.vim/.dein/build/index.js:32427:21)
   14     at async NeovimClient.<anonymous> (/home/yc/.cache/vim/dein/.cache/init.vim/.dein/build/index.js:10339:25)
   15 2020-02-10T19:39:50.744 ERROR (pid:95073) [plugin] - TypeError: highlights is not iterable
   16     at DocumentHighlighter.highlight (/home/yc/.cache/vim/dein/.cache/init.vim/.dein/build/index.js:65519:24)
   17     at async Handler.highlight (/home/yc/.cache/vim/dein/.cache/init.vim/.dein/build/index.js:64207:9)
   18     at async Plugin.cocAction (/home/yc/.cache/vim/dein/.cache/init.vim/.dein/build/index.js:32427:21)
   19     at async NeovimClient.<anonymous> (/home/yc/.cache/vim/dein/.cache/init.vim/.dein/build/index.js:10339:25)

Looks like this is only happened with R language server, try to upgrade R language server.

upgrade R languageserver can not resolve this problem.

I notice that this issue can only be reproduced when there is cursor movement action before the extensions are ready.

I think it's kind of expected to get errors in that case. Is autocmd CursorHold * silent call CocActionAsync('highlight') being recommended anywhere? First time I'm seeing this usage. I'd not recommend it as it can cause your editor to be slow or consume resources.

@oblitum autocmd CursorHold * silent call CocActionAsync('highlight') is in README.

I'm using this autocmd but never encountered this error.

Ah, ok then.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

czepluch picture czepluch  路  3Comments

marene picture marene  路  3Comments

rkulla picture rkulla  路  3Comments

npearson72 picture npearson72  路  3Comments

svenstaro picture svenstaro  路  4Comments