atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

Fix incorrect parsing of placeholders that point to other tab stops. #267

Closed savetheclocktower closed 6 years ago

savetheclocktower commented 6 years ago

Requirements

Description of the Change

266 describes a regression with tab stop behavior when the placeholder contains a reference to another tab stop. This almost certainly happened as a result of #260, but there wasn't any test coverage for this particular usage.

Alternate Designs

The parser was incorrectly assuming that all the items it would receive for a particular rule would be represented as strings, and that it could thus join them all together. Tabstop references are represented as objects. So I wrote a couple of utility functions to ensure that adjacent strings would be merged together without incorrectly coercing objects.

If there's an easier way to do this with a PEG, I'm all for it. Parser grammars are not my strong suit.

Applicable Issues

266

savetheclocktower commented 6 years ago

I can merge this myself, but I'll leave it open for a couple days in case other maintainers have feedback.

rsese commented 6 years ago

Thanks @savetheclocktower, I'll ask the team to take a look in case anyone has feedback for you :bow:

nathansobo commented 6 years ago

@joefitzgerald can you give this a spin and see if it fixes things?

joefitzgerald commented 6 years ago

I have tested and can confirm that this restores the behavior that was present in v1.24.1.

nathansobo commented 6 years ago

:heart::heart: