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

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

Open
asincrono opened this issue Nov 28, 2016 · 4 comments · May be fixed by #104
Open

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

asincrono opened this issue Nov 28, 2016 · 4 comments · May be fixed by #104

Comments

@asincrono
Copy link

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

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

ckLee8 commented Dec 22, 2016

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

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

keathley commented Jun 6, 2017

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.

mshenfield added a commit to mshenfield/language-elixir that referenced this issue Feb 18, 2018
The atom-brackets package is configured to expand "#" into "#{$1}" in `comment.documentation.heredoc.elixir` contexts. To avoid this and close elixir-editors#83, this changes literal heredoc contexts (`~S`) to have a more specific tag, `comment.documentation.heredoc.literal.elixir`.

Tested by `apm link`ing the modified `language-elixir` locally and confirmed that "#" no longer expanded in literal heredocs.  Also modified existing tests to expect the new name where appropriate.
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

Successfully merging a pull request may close this issue.

3 participants