Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands not working on elm 0.19 with vim 8 #164

Open
icaropires opened this issue Sep 15, 2018 · 12 comments
Open

Commands not working on elm 0.19 with vim 8 #164

icaropires opened this issue Sep 15, 2018 · 12 comments

Comments

@icaropires
Copy link

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
Copy link

blurrcat commented Oct 3, 2018

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
Copy link

carmonw commented Oct 4, 2018

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:

  • ElmMake
  • Syntastic
  • gf hotkey and the linkage between elm modules

Hope this helps!

@ghost
Copy link

ghost commented Oct 17, 2018

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
Copy link

carmonw commented Oct 18, 2018

@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:

  • Updated Syntastic/ElmMake to report non compilation based errors (i.e. the json report returns a type of error for import errors instead of a type of compile-error). Since reports that are of an error type don't include the line and column number, I have not been able to add functionality to jump to the offending line for import errors as of yet.
  • Fixed errors not being hidden when they are not related to the current file for Syntastic

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

@ckipp01
Copy link
Contributor

ckipp01 commented Nov 13, 2018

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
Copy link

ghost commented Nov 16, 2018

There is a solution out there : Zaptic/elm-vim
Here is the 0.19 upgrade commit
Zaptic@da0f86d
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
Copy link

andys8 commented Nov 25, 2018

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

@ckipp01
Copy link
Contributor

ckipp01 commented Nov 25, 2018

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

@daveman1010221
Copy link

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
Copy link

carmonw commented Mar 22, 2020

@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
Copy link

@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
Copy link

andys8 commented Mar 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants