Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Snippet syntax issue when converting from TextMate bundle #213

Open
@KazroFox

Description

@KazroFox

I was trying to convert the restructuredText tmbundle into an atom package, and for the most part it works properly, but the snippet syntax it creates from the tmbundle doesn't work.

apm init --package ~/.atom/packages/language-rst --convert https://github.com/textmate/restructuredtext.tmbundle

In TextMate when you type sec and auto complete, this happens:
expected behavior

(If you can't see the image, it inserts text and as you type it dynamically resizes the line below it so the section title remains in proper syntax)

In atom, doing the same process results in

subsection name
${1/(.)|\s/(?1:=:=)/g}

being inserted into the editor.

Unfortunately, I'm not familiar with the syntax that the atom snippets use, so I don't know how to fix this issue. Even if this isn't possible to be handled in atom, there should probably be some sort of case to handle these snippets.

Here's the contents of the snippets/language-rst.cson that apm outputs:

'.text.restructuredtext':
  'image':
    'prefix': 'image'
    'body': '.. image:: ${1:path}\n$0'
  'link':
    'prefix': 'link'
    'body': '\n\\`${1:Title}<${2:http://link}>\\`_'
  'section 1':
    'prefix': 'sec'
    'body': '${1:subsection name}\n${1/(.)|\\s/(?1:=:=)/g}\n$0'
  'section 2':
    'prefix': 'subs'
    'body': '${1:subsection name}\n${1/(.)|\\s/(?1:*:*)/g}\n$0'
  'section 3':
    'prefix': 'sss'
    'body': '${1:subsection name}\n${1/(.)|\\s/(?1:-:-)/g}\n$0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions