Unknown function: elm#FindRootDirectory
Asked Answered
S

2

6

I'm getting this error message: Unknown function: elm#FindRootDirectory When I open an elm-file within neovim.

I'm using ElmCast/elm-vim as a plugin to write elm code.

I know I could simply remove this plugin but I want to use it.

Also I figured out that I'm not be able to use any commands from ElmCast/elm-vim like :ElmFormat for example even if they are suggested in the wildmenu, but the syntax highlighting of this plugin is working.

I've installed the plugin via vim-plug:

call plug#begin('~/.vim/vim-plug-plugins')
        Plug 'elmcast/elm-vim'
call plug#end()

I also ran :PlugUpdate and :PlugUpgrade multiple times.

neovim CheckHealth says this:

health#deoplete#check
========================================================================
## deoplete.nvim
  - SUCCESS: has("nvim") was successful
  - SUCCESS: has("python3") was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - SUCCESS: no issues found

## Performance
  - SUCCESS: Build type: Release

## Remote Plugins
  - SUCCESS: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

## tmux
  - SUCCESS: escape-time: 10ms
  - INFO: $TERM: screen-256color

health#provider#check
========================================================================
## Clipboard (optional)
  - SUCCESS: Clipboard tool found: xsel

## Python 2 provider (optional)
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/bin/python2
  - INFO: Python2 version: 2.7.14
  - INFO: python2-neovim version: 0.1.13
  - SUCCESS: Latest python2-neovim is installed: 0.1.13

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python3 version: 3.6.2
  - INFO: python3-neovim version: 0.1.13
  - SUCCESS: Latest python3-neovim is installed: 0.1.13

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
  - WARNING: Missing "neovim" gem.
    - SUGGESTIONS:
      - Run in shell: gem install neovim
      - Is the gem bin directory in $PATH? Check `gem environment`.
      - If you are using rvm/rbenv/chruby, try "rehashing".
Smew answered 1/10, 2017 at 15:47 Comment(1)
Use the plugin's issue tracker.Boatyard
S
7

I found out that the loading order of the plugins is the problem. I'm also using vim-polyglot.

When first loading vim-polyglot before elmcast/elm-vim it results in the mentioned error.

If I first load elmcast/elm-vim before vim-polyglot it is working like before.

Smew answered 10/10, 2017 at 14:19 Comment(2)
I don't understand why this is the recommended answer since vim-polyglot includes ElmCast/elm-vim. If you are using the former, shouldn't you just delete the latter from your .vimrc? That's the approach I took, and I haven't noticed any consequences.Linneman
Heads-up: I tried removing elm-vim, per @hkgumbs' suggestion, but it didn't work. The actions I took included removing elm-vim from vim-plug configs, sourcing configs, running :PlugClean, then reopening the elm file. vim-polyglot isn't particularly helpful either in debugging this. It is probably more correct to lean on vim-polyglot, but the posted answer is a good enough hack for someone who is just dabbling in elm.Cytaster
S
0

It appears you don't have autoload/elm.vim in your runtime path.

How did you install the plugin?

I would recommend you to use something like vim-plug to handle it.

Stephanistephania answered 2/10, 2017 at 1:56 Comment(1)
I've updated the question to mention that I'm already using vim-plug.Smew

© 2022 - 2024 — McMap. All rights reserved.