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

Use do...end as code block delimiters #405

Open
kelvinst opened this issue Oct 2, 2017 · 8 comments
Open

Use do...end as code block delimiters #405

kelvinst opened this issue Oct 2, 2017 · 8 comments

Comments

@kelvinst
Copy link

kelvinst commented Oct 2, 2017

The current behaviour is considering only some keywords as block delimiters, like defmodule...end or def...end. I'm guessing this according to this behaviour in my delimiters highlighting:

screenshot 2017-10-01 21 55 27

Well, the behaviour I was expecting is hightlighting the do and end keywords, and not the definition ones.

My understanding goes this ways because in elixir, the block delimiters are actually do...end, which is actually just a syntax sugar for do: (...).

@kelvinst
Copy link
Author

kelvinst commented Oct 2, 2017

PS.: fn...end is also a block delimiter.

@kelvinst
Copy link
Author

kelvinst commented Oct 2, 2017

PS2.: I don't really know if this should be an Issue here or in smartparens, but I had to open it somewhere.

@kelvinst
Copy link
Author

kelvinst commented Oct 2, 2017

Nevermind what I said, updated my packages and it's pretty much working now. 😬

I say "pretty much" because I'm still having problems with try do ... end blocks. Are you aware of it?

@onelesd
Copy link

onelesd commented Mar 8, 2018

You could use evil-matchit, which is more general purpose and useful. It handles try do ... end fine.

@art-solopov
Copy link

I'm still having issues on functions that don't use do ... end syntax and instead use just the do: (...) expression.

@mogorman
Copy link

mogorman commented Jan 8, 2019

I am having the issue where end is not auto inserted for def, defp or defmodules, Also it is not matching the end, like it does with case and if blocks

@opie4624
Copy link

This also manifests if your function or module names start with the word end.

Screen Shot 2019-12-16 at 9 51 41 AM

@nicobao
Copy link

nicobao commented Mar 19, 2020

Hi! Here is another example where similar errors occur in Elixir: with the quote do.. end construct.

defmodule_end

defmodule_quote_do_end

Note sure whether it is related to this smartparens issue?

If someone is ready to provide some initial guidance, I'd be happy to help.

J3RN pushed a commit to J3RN/emacs-elixir that referenced this issue Apr 24, 2021
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