Contextual "hooks" that will allow extenders to provide additional functionality
See original GitHub issueExtenders wishing to add additional functionality to the Zowe Explorer need several “hooks” where they can link into. The most obvious being context menus on the explorer nodes (dataset, job, uss file)
The VSCode method of adding contributions is largely static in that commands, their activation and in particular 'when" clause has restricted us to pre-determined contextValues having an equivalence or non equivalence test on a string. This means the strings are fixed.
However it is possible to use a regular expression hence we are able to add additional strings that increase the possible combinations.
Currently we have tests such as
viewItem == job_fav
where job_fav is an explicit value of “job_fav” and any additional context string added by an extender would break the test
Using regexp we can write the following test
viewItem =~ /job.*_fav*/
which has the same result but doesn’t preclude the string being modified (albeit this example expects the type ‘job’ to be at the front)
And the test for removing a job favorite now becomes
viewItem =~ /(?!.*_fav).*job.*/
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
This issue links directly to #601 because the rendering of nodes during a getChildren operation is where the context of the nodes gets set and where we would consider adding an extension point. We do have an alternative however and that is to control what information is allowed here. Maybe work with our extenders to ensure that any requested attributes are reasonable and doesn’t clutter/break anything?
Thank you @travatine that’s a good example and there are probably more such examples to consider. This issue should be closed now as the code is already in master and scheduled for v1.5.0 release. What would probably be the best way forward is if you wouldn’t mind creating a new issue to include the Exec recommendation and maybe any others that would be of value.