slashmili/alchemist.vim

Unusable for large projects

jfrolich opened this issue · 6 comments

In a large elixir app there is a blocking lag before suggestions appear (3-5 seconds). It's already a bit noticeable in large elixir projects like Ecto, but there it's still sub-second. The app where this happens is ~ 20k lines of code with a number of large decencies like Ecto.

  1. Elixir/OTP/Python version

Elixir: Elixir 1.6.4

OTP: 20

Python: 3.6.5

  1. Are you using VIM or Neovim? Please provide the version.

Neovim/macvim

  1. Which pluging are you using:

[ ] basic omnifunc
[ ] YouCompleteMe
[x] deoplete

  1. Which steps of Debugging passed?

N/A

  1. Do you have a specific setup? Like Docker and etc

No

@jfrolich are you experiencing something like this or slower?

https://asciinema.org/a/bIY124FBntEdBM25I7wPXUw3x

I cloned the ecto project. the first autocomplete was slower because it had to run elixir_sense and wait for it to be responsive, the rest was quicker since the server is running.

Also please provide your neovim version

No much worse, see below. I have a 2015 macbook pro maxed out. And my neovim version is: NVIM v0.2.2
2018-04-23 16 34 39

May I know if you are using latest version of alchemist.vim?

BTW the screencast that I posted is wrong :D

This is the correct one https://asciinema.org/a/7XtFQVLBLP37yw2XSvuaBd8OV
Still the first . after Ecto runs elixir_sense for the first time so there is some delay and after that that's the usually speed.

FYI when you are using Neovim and deoplete, the deoplete plugin looks up the spec faster because it has direct connection to elixir_sense socket(#120)

BTW how do you execute the autocomplete? Are you pressing or you have something else that triggers the autocomplete?

Yes using the latest version. I am pressing <C-y> to trigger the autocomplete.

@jfrolich do you have your vimrc file somewhere for me to try it locally?

I use vimbox (https://github.com/jordwalke/VimBox) so it's pretty huge 😅, with this adaptation:

.vimrc.custom.after

" Overwrite this file with whatever you want. This will be executed after
" loading any of the stock bundles/settings.
" not sure why?
let g:deoplete#enable_at_startup = 1

" pretty nice hack to only ctrlP through files that are part of the git repo
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . -co --exclude-standard', 'find %s -type f']
let g:ctrlp_map = '<C-p>'
let g:ctrlp_cmd = 'CtrlP'
" CtrlP auto cache clearing.
" ----------------------------------------------------------------------------
function! SetupCtrlP()
  if exists("g:loaded_ctrlp") && g:loaded_ctrlp
    augroup CtrlPExtension
      autocmd!
      autocmd FocusGained  * CtrlPClearCache
      autocmd BufWritePost * CtrlPClearCache
    augroup END
  endif
endfunction
if has("autocmd")
  autocmd VimEnter * :call SetupCtrlP()
endif

let g:jsx_ext_required = 0

let g:prettier#autoformat = 0
" let g:prettier#exec_cmd_async = 0 
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue PrettierAsync
let g:prettier#config#single_quote = 'true'
let g:prettier#config#jsx_bracket_same_line = 'false'
let g:prettier#config#arrow_parens = 'avoid'
let g:prettier#config#bracket_spacing = 'true'

" clipboard works
set clipboard=unnamed

" enable line numbers
set number

" I don't have the patched powerline font
let g:airline_powerline_fonts = 0

" format on save (Elixir)
let g:mix_format_on_save = 1

" Also map Cmd-p to Ctrl-p
map <D-p> <C-p>

" tab autocomplete (use supertab)
" inoremap <expr> <Tab> pumvisible() ? "\<C-y>" : "\<Tab>"

" far: ignore some standard directories
set wildignore+=*/node_modules/*
set wildignore+=*/_build/*
set wildignore+=*/priv/static/*
set wildignore+=*/deps/*

let g:SuperTabDefaultCompletionType = "<c-n>"

and bundlesVimRc.custom

" Add custom bundles here using the `NeoBundle` command.
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'elixir-editors/vim-elixir'
if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif
Plug 'ervandew/supertab'
" Plug 'slashmili/alchemist.vim'
Plug 'mhinz/vim-mix-format'