Have different vscode-ibmi actions by directory #2653
Replies: 3 comments
-
A great idea indeed, I am excited to hear Seb chime in here. My simple thoughts:
|
Beta Was this translation helpful? Give feedback.
-
Since it was already doing one scan of the file system for
I didn't realize actions worked on multiple file selections, but I saw the existing code for it so I made sure to solve for that. It requires that action files are ancestors to all selected files. Some other things I considered while doing this:
I've been testing it with this setup:
This is commit is just an example of the logic that I've been toying with. I haven't looked at how to implement changes for the test cases yet for this. |
Beta Was this translation helpful? Give feedback.
-
@sebjulliand I am looking at this a little more today and the support of running an action against multiple URIs - this will be a very interesting feature to handle. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using these extensions for somewhat sizable project at the day job and I'm not at the point of doing some form of customized unit tests. I've had to build some extensive functionality into our actions using bash scripts that get run in PASE. It's working well for our kind of weird use case, but now I'm adding other source in and making a unit test framework.
I want the actions to be different based on the path that you're in.
src/
should be different than undertest/
I tried seeing what happens if I just created a
.vscode/actions.json
under a different path. I was intrigued to find that it merged all the actions together rather than making them distinctly available.So then looking at the code, I see the simple tests that are going on for deciding which actions to present:
vscode-ibmi/src/ui/actions.ts
Lines 71 to 77 in f59c151
I feel like it would be easy enough to implement a couple of options:
.vscode
folder on the action object and compare it against the file rootpath
, that restricts where the actions are presented. This could be a pattern.There might be other good options as well, but these two make sense to me.
The first option I gave would have you putting the action definitions in different files and maybe cluttering the file system more, but the tradeoff is that you have pretty clear separation between them.
The second option keeps them in one file (although two+ is still an option since it already merges them), but requires you to maintain that path if you move files around and can clutter the contents if you do decide to keep them all in one file (if you have a lot of actions).
I have no problems putting together a PR for this, but since I've not been working on this code base I for sure would like some feedback on any preferences for this kind of thing and if it is even going to be acceptable.
I think my preference would be the first one, where it will track the path to the .vscode folder it found the actions in and then only present actions that have a common root somewhere up the path.
Beta Was this translation helpful? Give feedback.
All reactions