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

Add support for variables LINE_COMMENT, BLOCK_COMMENT_START #21

Conversation

savetheclocktower
Copy link

…and BLOCK_COMMENT_END.

These are three of the four snippet variables that VSCode supports and we don't. You can do some nifty stuff with these, as pulsar#970's description illustrates.

The only one we don't yet support is UUID, and I've set that up so that we get it for free whenever we upgrade Electron. We are this close (imagine an index finger and a thumb very close together) to having a version of node with crypto.randomUUID; it'll basically happen whenever we upgrade Electron, even if it's a tiny bump. So I also made it so that the UUID unit tests will start running automatically as well in that scenario.

Would love to get this merged a few days before the 15th so I have time to make a PR that bumps snippets. (This is one of the very few remaining bundled packages in a separate repo — maybe the only one left? I'll have to address that soon.)

Testing

Wrote some new specs. If they pass, we're good to go.

Copy link
Member

@DeeDeeG DeeDeeG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I understood snippets better, but I'm finding it hard to meaningfully validate this before 1.116 would happen.

I like the premise, and I'm trusting a bit that the tests are good for this feature so that it "just works", leaning on that to "rubber-stamp approve" as it were.

Again, if there are good easy steps to manually test this, I will attempt to do so. (Similar to as I mentioned in my approval of #20.)

@savetheclocktower
Copy link
Author

I'm going to land this and the other one just so we can get it in for 1.116, but as for this:

Again, if there are good easy steps to manually test this, I will attempt to do so.

If you check out this repo, you can run ppm link . to substitute it for the built-in version. You can then add a snippet like the one described in pulsar#970 to your snippets file and verify that it works.

@savetheclocktower savetheclocktower merged commit 6aa1607 into pulsar-edit:master Apr 14, 2024
3 checks passed
@savetheclocktower savetheclocktower deleted the add-comment-delimiter-variables branch April 14, 2024 02:24
@savetheclocktower
Copy link
Author

(Forgot to mention that you'd have to run Pulsar on master so that it has the new method on TextEditor that this change expects.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants