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

Support brace ({}) expansion when creating new files #43

Open
mandx opened this issue Jul 21, 2022 · 3 comments
Open

Support brace ({}) expansion when creating new files #43

mandx opened this issue Jul 21, 2022 · 3 comments

Comments

@mandx
Copy link
Contributor

mandx commented Jul 21, 2022

Related to #40 #42

The idea would be that, when selecting "New file...", one could use braces to create sets of files:

  • /some/path/MyComponent.{tsx,scss} would expand to
    • /some/path/MyComponent.tsx
    • /some/path/MyComponent.scss
  • /some/path/my-module{,.test}.tsx would expand to:
    • /some/path/my-module.tsx
    • /some/path/my-module.test.tsx

It would also work on the path components (anywhere in the string, really).

While this would help me a lot personally, there are a few cons to implementing this:

  • I like the no-dependencies aspect of this lib, but since Python's stdlib doesn't support this, we would need to vendor a library to support this (I'm partial to braceexpand)
  • We would need to explain somehow to the user of the new capability, and personally I'm not sure how yet.
  • Should this be gated behind a preference
@braver
Copy link
Owner

braver commented Jul 25, 2022

I would say that the mental overhead is only worth it when adding more than two files. Putting in the braces and thinking about the syntax (even remembering it), would probably be slower for me than creating one new file and then duplicating it. Assuming of course you don't do this every day, then it might get handy.
If it can live as a "hidden" pro-level trick it won't bother anyone who doesn't use it. It might bother the maintainers of this package though 😄 I think I'd like to see more requests and use cases before deciding to put it in. For instance, is it really common to create both files at once? ... and to they commonly deviate only in small parts (eg. it doesn't look like it will work if your tests are in a different directory).

@mandx
Copy link
Contributor Author

mandx commented Jul 25, 2022

Those are good point, so now I'm leaning towards closing this ticket for now, and if it regains interest, we can reopen and maybe start work on it. What do you think?

@braver
Copy link
Owner

braver commented Jul 25, 2022

Let's leave it open for others to find. Maybe some people will come and add their ideas. If nothing happens for a while, we can always close it later.

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

No branches or pull requests

2 participants