rioj7 / commandOnAllFiles

Visual Studio Code extension to apply a command to all files in a Workspace
4 stars 0 forks source link

Some remarks #6

Open lzandman opened 3 months ago

lzandman commented 3 months ago

Thanks for you handy extension! It helped me refactoring a bunch of files in my workspaces. I do have a few remarks:

  1. Currently, you can specify filename extensions for include/exclude. It would be more flexible if you could use wildcards, glob patterns and/or even regular expressions.
  2. The example given in the README uses an advanced scenario, that also requires the additional multi-command extension. I must admit I hadn't read the instructions properly and wondered why it didn't work for me. I would start by specifying the simplest use case: executing just one command only. Then you could add the multi-command example as a more advanced scenario.
  3. The extension doesn't do much logging. As I said above, I first couldn't get it to work. VSCode's Output log didn't really help me.
  4. Files that are already open in VSCode get closed. They should be left opened. I noticed this was already reported earlier.
  5. Maybe add the possibility to leave edited files open, without saving them. This way you can preview the changes made and decide to save it yourself.

I've created a custom version of your extension that implements some of the things I remarked above. I could submit that as a PR, but that would require some refactoring (my code is pretty raw right now). I don't know if you're open to that?

rioj7 commented 3 months ago

@lzandman

I have split this issue to separate issues that can be put in separate commits.

About 2): The second line of the README mentions the multi-command extension. If you stick to the shown example and not reading all the docs you can execute 1..n commands with possible arguments, if you only use 1 command but need arguments you need to use multi-command.

About 3): What kind of logging did you expect to see? Should logging be on by default and possible to switch on/off per commandOnAllFiles.commands entry?

About 4): You can add a Thumbs Up emoji to issue #3