elixir-editors / language-elixir

Elixir language support for the Atom editor.
Other
181 stars 40 forks source link

'#' replaced by '#{}' inside documentation blocks. #83

Open asincrono opened 7 years ago

asincrono commented 7 years ago

When I type '#' inside ' """ ' documentation block I get it replaced by '#{}'. I understand it should be interpreted as a markdown code. I get:

@moduledoc """
Blah blah blah

#{#{ Examples}}
"""

instead of

@moduledoc """
Blah blah blah

## Examples
"""

Am I doing something wrong?

keathley commented 7 years ago

The heredoc string is still a string. So the # is expanded to #{} like it is in other strings. Since heredocs allow string interpolation I'm not sure that this is a bug. However, ~S""" also auto-expands the # which definitely is a bug. It should work the same way that ~S does.

ckLee8 commented 7 years ago

I've been having trouble with this too. I tried creating an docexample snippet to maybe get a work around, but it isn't triggered because atom is picking up anything inside a @doc as a string :(

'docexample': 'prefix': 'docexample' 'body': '\n## Examples\n\n\t\t\t$0\n'

EDIT: This works and is a good work around. Autocomplete won't show up but if you type out the entire 'docexample' and press tab it will auto complete

keathley commented 7 years ago

Looks like we'll need to submit a fix upstream to the atom/bracket-matcher plugin. This line needs to be removed:

https://github.com/atom/bracket-matcher/blob/075251fc2d36bd71b139a2ca153f67313cc052d5/lib/bracket-matcher.coffee#L166.

keathley commented 7 years ago

This issue has been open for a while now. Sorry about that. I'm going to try to take care of this within the next week or so. But @ckLee8 if you would like to submit a PR to bracket matcher then feel free 👍 . If not then no worries. I'll try to take care of it soon.