Skip to content
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

Add snippets #12

Open
Natrium729 opened this issue Dec 12, 2023 · 0 comments
Open

Add snippets #12

Natrium729 opened this issue Dec 12, 2023 · 0 comments

Comments

@Natrium729
Copy link
Contributor

I’ve been using some personal Dialog snippets for a while, and it might be a good idea to add them to the extension.

Here’s the list (as "name, identifier"), with the tab stops indicated with vertical bars. I’m not too sure about some of the things. I can make a pull request when we’ve settled them.

If statement, if:

(if) | (then),
    |
(endif)

If-else statement, if-else:

(if) | (then),
    |
(else)
    %% Indentation is also inserted here.
(endif)

For if-else, we could remove the hyphen from the identifier, it would be less to type. (Or we could allow both, but it’s a bit redundant.)

Select statement, select:

(select)
    |
(or)
    %% Indentation is also inserted here.
(stopping|at random|purely at random|cycling|then at random|then purely at random)"

For the select statement, the cursor first jumps at the end, with an autocomplete pop-up to, ahem, select the variant, then goes to the content after the (select). I like it, but maybe we should also add a snippet for each variant (a stopping, an at-random and so on) directly too?

Collect statement, collect:

(collect |$Element)
    |
(into |$List)

The cursor first jumps to $Element then to $List (so that the author can change the names), to end in the middle.

Collect words statement, collect words:

(collect words)
    |
(into |$List)

The cursor first jumps to $List.

Accumulate statement, accumulate:

(accumulate |$Element)
    |
(into |$Sum)

Same as collect.

Determine object statement, determine object:

(determine object |$Obj)
    |
(from words)
    %% Indentation is also inserted here.
(matching all of |$List)

I guess no regular author will ever use that one, but it’s here for completeness. Maybe we should remove the space in the identifier, or replace it with a hyphen.

IFID, ifid:

(story ifid) UUID

Where UUID is a UUID that has just been generated.


I don’t think there are others we could add?

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

No branches or pull requests

1 participant