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

Nested tab stops now expand incorrectly #266

Closed
isiahmeadows opened this Issue Mar 17, 2018 · 6 comments

Comments

Projects
None yet
6 participants
@isiahmeadows

isiahmeadows commented Mar 17, 2018

Prerequisites

Description

[Description of the issue]

Steps to Reproduce

  1. Add a snippet with the body '() => ${1:\\{$2\\}}'
  2. Open a new file
  3. Change to a language where that snippet will be in scope
  4. Start to type it and hit tab to expand it

Expected behavior: [What you expect to happen]

It to expand like this with the brackets selected:

() => {}

Actual behavior: [What actually happens]

It expands like this, with the brackets selected:

() => {[object Object]}

Reproduces how often: [What percentage of the time does it reproduce?]

100% of the time

Versions

You can get this information from copy and pasting the output of atom --version and apm --version from the command line. Also, please include the OS and what version of the OS you're running.

Atom v1.25.0 on macOS 64-bit. This bug did not exist in v1.24.1.

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

@nemoDreamer

This comment has been minimized.

nemoDreamer commented Mar 28, 2018

I have a bunch of snippets where a group references another group:

'.source.js':
    'Console Log':
        'prefix': 'cl'
        'body': '$3console.${2:log}($1);$0'
    'Console Log (verbose)':
        'prefix': 'cll'
        'body': "$4console.${3:log}('${2:$1}', $1);$0"
    'Console Log (labeled, verbose)':
        'prefix': 'clll'
        'body': "$5console.${4:log}('$1: ${3:$2}', $2);$0"

Typing cll ⇥ and typing something would result in 2 cursors:

console.log("myMysteryHash|", myMysteryHash|);

But now, it only does

console.log("[object Object]", myMysteryHash|);

I do not see the ${2:$1} pattern mentioned anywhere in the snippet docs. Was I just taking advantage of something I shouldn't have?

Could there be a backreference format instead, like ${2:\\1}?

@joefitzgerald

This comment has been minimized.

Member

joefitzgerald commented Apr 9, 2018

This is definitely an issue; it's affecting go-plus autocomplete snippet expansion:

kapture 2018-04-09 at 16 00 06

screen shot 2018-04-09 at 4 02 13 pm

@savetheclocktower

This comment has been minimized.

Collaborator

savetheclocktower commented Apr 9, 2018

Oddly enough, this usage had no coverage in the tests. #267 ought to fix it.

@rsese

This comment has been minimized.

Member

rsese commented Apr 9, 2018

Thanks for the report @isiahmeadows, just noting that I can reproduce on macOS 10.12.6 with 1.26.0-beta1 but it's not reproducible on 1.24.1 like you mentioned.

@isiahmeadows

This comment has been minimized.

isiahmeadows commented Apr 10, 2018

@rsese Thanks! (It kind of didn't help that it broke some of my most frequently used snippets - I noticed within minutes of upgrading and about 36 hours from when it was first released.)

@jasonrudolph

This comment has been minimized.

Member

jasonrudolph commented Apr 11, 2018

Fixed in #267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment