Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Allow variables in snippets #9

Closed
@savetheclocktower

Description

@savetheclocktower

Have you checked for existing feature requests?

  • Completed

Summary

TextMate allows for certain variables to be defined in snippets that map to various things when the snippet is expanded. Most of these have also made it into the LSP specification for snippets.

Pulsar should support this entire list. This means not just substituting them during snippet expansion, but also allowing them to be transformed using the same syntax that already exists for transforming tab stops.

This enhancement does not depend on #8, but for reasons described in that issue, it would be odd to add support for variables without also making snippets triggerable via keystroke.

What benefits does this feature provide?

Aside from the new functionality it enables, it makes our snippets more compatible with the LSP specification, and with snippets as they've been implemented by VSCode, Sublime Text, and TextMate.

Any alternatives?

Not really. If this functionality is worth adding, it's worth doing it this way instead of introducing one that's purposefully incompatible.

Other examples:

See also the VSCode documentation for snippets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions