ElmCast / elm-vim

Elm plugin for Vim
BSD 3-Clause "New" or "Revised" License
572 stars 102 forks source link

Commands not working on elm 0.19 with vim 8 #164

Open icaropires opened 6 years ago

icaropires commented 6 years ago

The commands ElmMake and ElmRepl are not working on my vim 8.1 and elm 0.19 running on Manjaro Linux. The message elm-vim: could not find elm-make [http://elm-lang.org/install] is shown for ElmMake and almost the same for ElmRepl. I have tried to create bash alias but it doesn't work either. Also tried to change "elm-make" to "elm make" on elm#Build() but it can't find elm.json file.

blurrcat commented 5 years ago

As a temporary solution, what i did was to put the following file somewhere in your PATH:

echo "exec elm make $@" > elm-make
chmod u+x ./elm-make
mv elm-make /usr/local/bin/
carmonw commented 5 years ago

Making an alias for elm-repl should be sufficient to get things working, but an alias should not work for elm-make since the structure of the json report has changed in 0.19.

As mentioned in another issue, I'm not a vimscript expert but I have made some changes in my fork (https://github.com/carmonw/elm-vim) to add support for elm 0.19 for the following things:

Hope this helps!

ghost commented 5 years ago

OK I changed to carmonw/elm-vim and it solves some problems.

@icaropires I had the same 'can't find elm.son file' ; and that is because the elm#FindRootDirectory() function looks up for the nearest ancestor directory that has a ... elm-package.json file (hard-coded). So carmonw/elm-vim will allow you to compile.

@carmonw thank you for your work and sharing it. Have you tried to make a pull request to ElmCast/elm-vim with your changes ? I think we would all be better off if all efforts are combined. Since the main effort seems to be vimscript rather than the actual changes brought by the 0.19, I suspect that elm-vim was not updated because of a lack of time.

@carmonw btw the exploitation of the report is not fully correct, I'll make an issue on your project.

carmonw commented 5 years ago

@Syllogie I have not attempted to make a pull request yet, I think there is still a lot of work that needs to be done before a PR should be made. When I get more time I could look into making a proper 0.19 update, but for now I have only added functionality for things that I use in my typical workflow.

Also, I just made some additional changes to my fork if you want to check it out. I'm not sure what you mean by the exploitation of the report is not fully correct, but I was able to fix some issues that I came across recently which you can find a summary of below:

Hope these changes help! Let me know if there is anything I can help with.

ckipp01 commented 5 years ago

Is there any update on when some of these issues will be fixed or looked into? I use neovim and have also tried with vim 8 and the language server doesn't recognize the correct root of the project and some of the :Elm commands don't work at all.

Is there active development or rather review going on? I see quite a few pull requests, but not a lot of maintainer input. My vimscript isn't too great, but I'd be willing to help triage some stuff or get the ball moving somehow if I can.

ghost commented 5 years ago

There is a solution out there : Zaptic/elm-vim Here is the 0.19 upgrade commit https://github.com/Zaptic/elm-vim/commit/da0f86d2cde209fd8942c2671dbb1ced528ec075 I use it in conjunction with w0rp/ale (but I do not think it is necessary)

There are so many forks of Elmcast/elm-vim, I can't help but think that the collaboration through PR is perhaps not as smooth as it should.

andys8 commented 5 years ago

Thing is, the plugin should probably stay backwards compatible and use different commands for 0.18 and 0.19.

ckipp01 commented 5 years ago

@andys8 that makes sense. I'll change my PR to include both options depending on the version of elm.

daveman1010221 commented 4 years ago

Is switching to carmonw/elm-vim the recommended fix for getting elm-vim to work with 0.19? I'm having this exact issue in March of 2020. Thanks. :-)

carmonw commented 4 years ago

@daveman1010221 I haven't visited this repo in a while, but I think there are many forks at this point. Last I checked all the forks are missing one thing or another. My fork is just one of many, which I updated back in 2018 to support the things necessary in my workflow (i.e. ElmMake, Syntastic, gf). My recommendation would be to pick the one that works best for you.

daveman1010221 commented 4 years ago

@carmonw I sort of came to the same conclusion, too many broken things everywhere. It seems using VS Code may be the better option. Thanks for the quick reply. :-)

andys8 commented 4 years ago

Best option as of today is using the elm language server. It's used in vs code but can be used with any editor including Vim.

See https://github.com/elm-tooling/elm-vim/blob/master/README.md