profile
viewpoint

Ask questionsConstantly getting "no mixfile found in project" error (Vim)

I am using NeoVim with LanguageClient-neovim. As soon as I open NeoVim in any Elixir project, I get the following error and nothing else from ElixirLS:

No mixfile found in project. To use a subdirectory, set `elixirLS.projectDir` in your settings

Here is an example of the error in a brand new, blank Mix project: asciicast

Here is my .vimrc if it is of any use:

""""""""""""""""
" Key Bindings "
""""""""""""""""

" Shortcut to Vim Buffkill a buffer with CTRL+C
" map <C-c> :BD<cr>

" Shortcut to FZF :Files with \f
nnoremap <leader>f :Files<cr>

" Shortcut to FZF :Buffers with \b
nnoremap <leader>b :Buffers<cr>

" Shortcut to FZF :Lines with \l
nnoremap <leader>l :Lines<cr>

" Use the LanguageClient NeoVim key bindings in Elixir file buffers only to avoid
" breaking normal functionality
augroup elixir-bindings
  autocmd FileType elixir nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<CR>
  autocmd FileType elixir nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
  autocmd FileType elixir nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
augroup END

""""""""""""""""""""
" End Key Bindings "
""""""""""""""""""""

"""""""""""
" Plugins "
"""""""""""

" Install Vim Plug into the NeoVim autoload folder if not installed
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
  silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')

" Installed plugins
Plug 'elixir-lang/vim-elixir'
Plug 'tpope/vim-endwise'
Plug 'scrooloose/nerdcommenter'
Plug 'airblade/vim-gitgutter'
Plug 'alvan/vim-closetag'
Plug 'junegunn/fzf.vim'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-fugitive'
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 'autozimu/LanguageClient-neovim', {
  \ 'branch': 'next',
  \ 'do': './install.sh',
  \ }

" Initialize plugin system
call plug#end()

"""""""""""""""
" End Plugins "
"""""""""""""""

"""""""""""
" General "
"""""""""""

" Turn syntax highlighting on
syntax enable

" Set the background to dark (required for colors)
set background=dark

" Fix backspace so that it works normally
set backspace=indent,eol,start

" Indentation settings
" show existing tab with 2 spaces width
set tabstop=2
" when indenting with '>', use 2 spaces width
set shiftwidth=2
" On pressing tab, insert 2 spaces
set expandtab

" Turn case sensitive search off and smartcase search on
set ignorecase
set smartcase

" Turn on line numbers
set number

" Allow buffer switching without saving
set hidden

" Fold based on syntax
set foldmethod=syntax

" Only fold at top level
set foldnestmax=1

" Don't fold files by default
set nofoldenable

" Add fzf base plugin
set rtp+=/usr/local/opt/fzf

"""""""""""""""
" End General "
"""""""""""""""

""""""""""""""""""
" NERD Commenter "
""""""""""""""""""

" Add a space for all comments
let NERDSpaceDelims=1

""""""""""""""""""""""
" End NERD Commenter "
""""""""""""""""""""""

""""""""""""""""
" Vim Closetag "
""""""""""""""""

" Add *.eex to the file types in which tags get auto-closed
let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.eex'

""""""""""""""""""""
" End Vim Closetag "
""""""""""""""""""""

""""""""""""
" Deoplete "
""""""""""""

" Enable deoplete
let g:deoplete#enable_at_startup = 1

""""""""""""""""
" End Deoplete "
""""""""""""""""

"""""""""""""""""""""""""
" LanguageClient NeoVim "
"""""""""""""""""""""""""

" Use the ElixirLS shell script from $PATH
let g:LanguageClient_serverCommands = {
  \ 'elixir': ['elixir-ls.sh'],
  \ }

let g:LanguageClient_diagnosticsDisplay = { 
  \ 1: { 
      \ 'texthl': 'ErrorMsg',
      \ "signText": "X",
      \ "signTexthl": "ErrorMsg",
    \ },
  \ 2: { 
      \ 'texthl': 'WarningMsg',
      \ "signText": "!",
      \ "signTexthl": "WarningMsg",
    \ },
  \}

"""""""""""""""""""""""""""""
" End LanguageClient NeoVim "
"""""""""""""""""""""""""""""

Environment

  • Elixir & Erlang versions (elixir --version): Elixir 1.6.0, OTP 20.0
  • Operating system: OSX
  • Client (editor or IDE): NeoVim

Crash report template

  1. If using a client other than VS Code, please try VS Code's ElixirLS extension. Does it reproduce your failure? No.

  2. Create a new Mix project with mix new empty, then open that project with VS Code and open an Elixir file. Is your issue reproducible on the empty project? If not, please publish a repo on Github that does reproduce it. Not reproducible in VSCode.

JakeBecker/elixir-ls

Answer questions Attrams

Hey, @jswny check this StackOverflow solution

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List