-
Notifications
You must be signed in to change notification settings - Fork 91
Add support for Elixir arrays #163
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
Conversation
|
On a sidenote: as a byproduct of this, I managed to add some missing tests for Elixir and I'm currently working my way through maps and arrays via sigils. I'll be making a few more PRs adding those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for you work! This looks good to me, although I did find issues in some edge cases. Could you take a look?
I also see there's a build failure, which I think happens because the build runs on Vim 7.4.52, which is quite old. I wouldn't be surprised if it's missing Elixir support, which would mean indentation doesn't work. It's a pain in the ass, getting newer filetypes to work for the build. I mostly mark them as pending when run in TravisCI, or I remove all indentation in the assertions, both of which are clumsy solutions.
If you can find a way to fix the build with either of these methods, go ahead, but I don't consider it important -- I can handle this later. I'm starting to think I could just add the extra language support via git submodules to the test setup (like I'm doing here).
|
Thanks for reviewing! I'll be handling these later today. I did have some issues running the tests with indentation (especially adding tests to existing do-blocks on a different branch) because macvim also has some issues with indentation. It'd really help if I could add a submodule for In fact, it already depends on it since the delimiters used in |
Yes, there's a lot of dependencies, to Rust as well. A couple of days ago, I decided to vendor these in specs, and this seems to be working fine. Here's the lines that load the plugins: splitjoin.vim/spec/spec_helper.rb Lines 14 to 16 in 99d1200
And here's the So, you could do the same for vim-elixir, but I can do that for you as well -- if you'd like, focus on your fix and I'll get the tests running afterwards. |
|
Sorry it took me a couple of months but finally got to handle this. I think these scenarios should now all be handled :) |
AndrewRadev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recently merged another PR that added some Elixir specs, so that might have created some conflicts for you. Sorry for that! 😅
In any case, the cases do seem to be handled and the code looks good -- I'll go ahead and merge. Thank you for your work!
This PR adds support for array splitting and joining in Elixir.
Works with the following examples:
I did manage to find an edge case where this doesn't work:
However, to handle this it's necessary to build a parser and given it's such an uncommon edge case (updating a map when declaring the last element of an array), I assumed it wouldn't be worth the effort.