Skip to content

Instantly share code, notes, and snippets.

@mike-hearn
Last active January 22, 2019 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-hearn/247a7f04178f7c4dd352ae352707a4e2 to your computer and use it in GitHub Desktop.
Save mike-hearn/247a7f04178f7c4dd352ae352707a4e2 to your computer and use it in GitHub Desktop.
YouCompleteMe multiple completer issue

YCM Blacklist / On-Complete-Done bug

This gist demostrates the issue with a competing completion engine on filetypes where YCM is supposed to be blacklisted.

Steps to reproduce

  1. Enter the docker bug environment with: docker run --rm -ti mikehearn/ycm-bug

  2. Open an empty viml file with vim example.vim

  3. Start a coc.nvim completion in the file by typing function and hitting enter

  4. Open a blank example python file with :e example.py

  5. Trigger a YCM completion first by typing import json and then on the next line json.loads

  6. Go back to the original example.vim buffer with :b #

  7. Type func to start the completion, hit TAB to go down to the first results ("function") and hit ENTER

version: '3'
services:
ycm_bug_demonstration:
build: .
FROM fedora:29
RUN curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
RUN dnf install --refresh -y vim git cmake gcc-c++ make python3-devel python-devel nodejs yarn
RUN npm install -g vim-node-rpc
RUN adduser -m vimuser
USER vimuser
ADD ./vimrc /home/vimuser/.vimrc
RUN vim +PlugInstall +qa +qa
CMD bash
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
" Just a baseline install
Plug 'sheerun/vimrc'
Plug 'sheerun/vim-polyglot'
" Completion plugins
Plug 'Shougo/neco-vim'
Plug 'neoclide/coc-neco'
Plug 'neoclide/coc.nvim', {'tag': '*', 'do': 'yarn install', 'for': ['json', 'lua', 'vim', 'vue']}
Plug 'Valloric/YouCompleteMe', {'do': './install.py'}
call plug#end()
" coc.nvim run on vim files only
autocmd BufNew,BufEnter *.vim execute "silent! CocEnable"
autocmd BufLeave *.vim execute "silent! CocDisable"
inoremap <c-c> <ESC>
" YCM Settings, blacklist for vim files
let g:ycm_filetype_blacklist = { 'vim': 1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment