Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Disable the JSRefactor Menu based on context #14798

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shubhsnov
Copy link
Collaborator

@shubhsnov shubhsnov commented May 21, 2019

@swmitra for review

+@narayani28

@navch
Copy link
Contributor

navch commented May 22, 2019

Are we intending to disable only context menus, not from the menu bar?

@shubhsnov
Copy link
Collaborator Author

shubhsnov commented May 23, 2019

There are few issues here: Until now we used to provide features for JS only, in which case it worked to have these shortcuts and triggers be a part of JS. But we're planning to incorporate other languages now, so the question is - what would happen when we want to provide refactoring for PHP or even TS?

These features should be handled centrally and the extension should only work as a provider.
So we might need to move these to the core.

As for menu bar, that is actually a bit complex. We do have capture event for the context menu but not the menu bar since that is shell based. I'll see what I can do.

@navch
Copy link
Contributor

navch commented May 23, 2019

Sounds good 👍 Agreed this should be handled centrally. Maybe we can also think of removing these menus from menus bar as after adding these menus Edit looks really odd.

CommandManager.get(REFACTORWRAPINCONDITION).setEnabled(false);
CommandManager.get(REFACTORCONVERTTOARROWFN).setEnabled(false);
CommandManager.get(REFACTORCREATEGETSET).setEnabled(false);
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please handle using else to keep the code more logical.

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

Successfully merging this pull request may close these issues.

3 participants