Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coc and YCM incompatible #3503

Closed
eyalk5 opened this issue Oct 10, 2019 · 10 comments
Closed

Coc and YCM incompatible #3503

eyalk5 opened this issue Oct 10, 2019 · 10 comments

Comments

@eyalk5
Copy link

eyalk5 commented Oct 10, 2019

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your issue:

  • [x ] I have read and understood YCM's [CONTRIBUTING][cont] document.
  • [ x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
  • [ x] I have read and understood YCM's [README][readme], especially the
    [Frequently Asked Questions][faq] section.
  • [ x] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. ([Example Google
    search.][search])
  • [ x] If filing a bug report, I have included the output of vim --version.
  • [ x] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [ x] If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • [x ] If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • [ x] If filing a bug report, I have included a minimal test case that reproduces
    my issue, including what I expected to happen and what actually happened.
  • [ x] If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • [ x] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt gift of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [x ] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key
questions:

  • What did you do?
    with youcompleteme enabled in tex file (using vimtex)
    I typed some letter for example \usepacakge{
    When I type the { , the error appears

PS the only reason I use ycm for this file is because of ultisnip completion.

  • What actually happened?

    Error detected while processing function 257_OnCompleteDone[5]..provider#python3#Call:
    line 18:
    Error invoking 'python_execute' on channel 4 (python3-script-host):
    Traceback (most recent call last):
    File "", line 1, in
    File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/python/ycm/youcompleteme.py", line 509, in OnCompleteDone
    completion_request.OnCompleteDone()
    File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/python/ycm/client/completion_request.py", line 87, in OnCompleteDone
    self._OnCompleteDone_FixIt()
    File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/python/ycm/client/completion_request.py", line 130, in _OnCompleteDone_FixIt
    completions = self._GetCompletionsUserMayHaveCompleted()
    File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/python/ycm/client/completion_request.py", line 104, in _GetCompletionsUserMayHaveCompleted
    return [ completions[ int( completed_item[ 'user_data' ] ) ] ]
    ValueError: invalid literal for int() with base 10: '{"cid":1570702627,"source":"vimtex","index":754}'

Diagnostic data

Output of vim --version

NVIM v0.4.0-1989-g754ea8d27
Build type: Release
LuaJIT 2.0.5
Compilation: /Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/Users/travis/build/neovim/bot-ci/build/neovim/build/config -I/Users/travis/build/neovim/bot-ci/build/neovim/src -I/Users/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/local/opt/gettext/include -I/usr/include -I/Users/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/Users/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@Traviss-Mac-6.local

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Place the output here, or a link to a [gist][].

Output of YcmDebugInfo

Place the output here, or a link to a [gist][].

-- Client logfile: /var/folders/rr/ht4whxv978xdd88mlqhy44br0000gn/T/ycm_3g3lnbv8.log
-- Server Python interpreter: /usr/local/bin/python3
-- Server Python version: 3.7.0
-- Server has Clang support compiled in: True
-- Clang version: clang version 6.0.0 (tags/RELEASE_600/final)
-- Extra configuration file found and loaded
-- Extra configuration path: /Users/eyalkarni/vimpy3/globalycm.py
-- Server running at: http://127.0.0.1:58035
-- Server process ID: 38942
-- Server logfiles:
-- /var/folders/rr/ht4whxv978xdd88mlqhy44br0000gn/T/ycmd_58035_stdout_6i2p5_n_.log
-- /var/folders/rr/ht4whxv978xdd88mlqhy44br0000gn/T/ycmd_58035_stderr_0bdaksbc.log

Contents of YCM, ycmd and completion engine logfiles

2019-10-10 12:50:01,450 - INFO - Received ready request
2019-10-10 12:59:59,479 - INFO - Received health request
2019-10-10 13:07:07,182 - INFO - Received event notification
2019-10-10 13:07:07,191 - INFO - Adding ONE buffer identifier for file: /Users/eyalkarni/thesisnew/newzig.tex
2019-10-10 13:07:07,193 - ERROR - No semantic completer exists for filetypes: ['tex']
Traceback (most recent call last):
File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/third_party/ycmd/ycmd/../ycmd/server_state.py", line 101, in FiletypeCompletionAvailable
self.GetFiletypeCompleter( filetypes )
File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/third_party/ycmd/ycmd/../ycmd/server_state.py", line 90, in GetFiletypeCompleter
current_filetypes ) )
ValueError: No semantic completer exists for filetypes: ['tex']

OS version, distribution, etc.

MACOS high sierra

@puremourning
Copy link
Member

this looks like a conflict with another plugin. can you please try with the following vimrc (e.g. save as min_vimrc and run vim -Nu min_vimrc):

set rtp+=/path/to/YouCompleteMe
filetype plugin indent on

Obviously, change the path.

@puremourning
Copy link
Member

Please also test in Vim, not neovim.

@bstaletic
Copy link
Collaborator

No answer, closing. Feel free to reopen after providing the requested info.

@eyalk5
Copy link
Author

eyalk5 commented Nov 5, 2019

minimal .vimrc:

set rtp+=~/vimpy3/plugged/youcompleteme 
filetype plugin indent on
so ~/vimpy3/autoload/plug.vim
call plug#begin('~/.vim/plugged') 
Plug 'lervag/vimtex'
Plug 'neoclide/coc-neco'
Plug 'neoclide/coc.nvim', {'branch': 'release','do': { -> coc#util#install()}}
call plug#end() 
let g:tex_flavor='latex'
let g:vimtex_quickfix_mode=0
set conceallevel=1
let g:tex_conceal='abmg'  "'abdmg'
let g:vimtex_enabled=1 
let g:ycm_filetype_whitelist = {'c': 1,'cpp':1,'tex':1} 

You need to run :CocInstall coc-vimlsp.
Well, some of the vimtex settings are redundant probably.

Anyway, it seems like a collsion between coc and ycm. When I disable coc , it is fine.

to reproduce, hit $\math complete to $\mathcal and enter (.

happens both in vim and nvim.

@eyalk5
Copy link
Author

eyalk5 commented Nov 5, 2019

Oh, sorry, the error is a bit different . This error happens a lot. and the original one not as many.

Error detected while processing function <SNR>35_OnCompleteDone[5]..provider#python3#Call: line 18: Error invoking 'python_execute' on channel 4 (python3-script-host): Traceback (most recent call last): File "<string>", line 1, in <module> File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/python/ycm/youcompleteme.py", line 509, in OnCompleteDone completion_request.OnCompleteDone() File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/python/ycm/client/completion_request.py", line 87, in OnComple teDone self._OnCompleteDone_FixIt() File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/python/ycm/client/completion_request.py", line 130, in _OnComp leteDone_FixIt completions = self._GetCompletionsUserMayHaveCompleted() File "/Users/eyalkarni/vimpy3/plugged/youcompleteme/python/ycm/client/completion_request.py", line 104, in _GetCom pletionsUserMayHaveCompleted return [ completions[ int( completed_item[ 'user_data' ] ) ] ] ValueError: invalid literal for int() with base 10: '{"cid":1572986183,"source":"vimtex","index":0}'

@eyalk5
Copy link
Author

eyalk5 commented Nov 5, 2019

Related:
neoclide/coc.nvim#1240
#3274
#2680

Please reopen

@puremourning
Copy link
Member

seems like a collsion between coc and ycm

Yeah, clearly. Not a YCM issue. Coc and YCM are clearly incompatible and cannot be used together.

@puremourning
Copy link
Member

Please reopen

Doesn’t look like a YCM issue. YCM assumes it is owning the complete func. If something messes with that, there’s nothing we can reasonably do.

@eyalk5
Copy link
Author

eyalk5 commented Nov 5, 2019

It is not that obvious. I thought to myself, well, let coc complete vimtex, and use ycm to complete ultisnip. And the completion suggestions for coc will be joined with those of ycm. I was even careful enough to set ycm on a whitelist for filetypes (but I am not sure what will happen on c++ , where I can't disable completely coc).
If these plugins are not compatible, I would think about adding a warning(when detecting another completion function , or even in case of this error, or when detecting specifically coc). It would be nice to prevent headaches to other people

@eyalk5 eyalk5 changed the title Shows error upon completion (no semantic completion) Coc and YCM incompatible Nov 5, 2019
@bstaletic
Copy link
Collaborator

If you want a vimscript LSP server, why don't you just tell ycm to use it? We do support g:ycm_language_server.

andreaswachowski added a commit to andreaswachowski/dotfiles that referenced this issue Nov 29, 2019
I ran into issues when pressing <Tab> in some situations and
YouCompleteMe producing all sorts of errors.

Turns out YouCompleteMe and coc.nvim are incompatible with each other,
see ycm-core/YouCompleteMe#3503
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants