question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Contextual "hooks" that will allow extenders to provide additional functionality

See original GitHub issue

Extenders 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Colin-Stonecommented, Mar 25, 2020

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?

0reactions
Colin-Stonecommented, Apr 15, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced React - useContext and useReducer hooks
Before hooks, we would have use of ThemeContext.Consumer in order get the context out of the component hierarchy. However, using the new useContext...
Read more >
How We Use Custom React Hooks With Context - YouTube
Tap to unmute. If playback doesn't begin shortly, try restarting your device. Your browser can 't play this video. Learn more. Switch camera....
Read more >
How to Use and Implement Context and useContext Hook with ...
Hooks — Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class....
Read more >
How to Use React Hooks Like a Professional | by Caelin Sutch
You can extract your components' logic into many reusable functions as custom Hooks, allowing you to create similar local state across your application, ......
Read more >
State Management with Context API & Custom MultiSelect ...
Create our own custom hooks and use Context API in React to prevent prop-drilling and use state management anywhere in the application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found