wix-incubator / vscode-glean

The extension provides refactoring tools for your React codebase
MIT License
1.46k stars 56 forks source link

Cannot open context menu to see the conversion actions #84

Open vfonic opened 4 years ago

vfonic commented 4 years ago

I'm having some difficulties opening the context menu with the glean actions. If I right-click on the editor side, nothing opens. The only way I can use glean is if, sometimes glean actions present themselves in a "lightbulb's" context menu.

I don't know how to best explain this, so here's a screen recording: https://www.dropbox.com/s/48jofoz4qlt9srp/Glean.mov?dl=0

I also tried running glean commands from the command palette, but without success.

Any ideas?

Thanks!

jacquesdev commented 4 years ago

Same issue here

borislit commented 4 years ago

Hey @jacquesdev @vfonic. Basically, glean actions are only available through the lighbulb context menu, as this is the vscode standard for context based actions (i.e make something available only when relevant). Do you have issues with having the actions appear in the lightbulb? Can you please post the code snippet u are trying to refactor? I'd be glad to have a look

vfonic commented 4 years ago

Hey @borislit!

The issue is that the lightbulb doesn't appear at all. Not the action in the lightbulb, but the lightbulb itself.

Glean doesn't trigger the lightbulb to appear. I can only use glean action when some other extension creates the lightbulb. Then, I do see the glean action.

My current approach is to misspell some word and use Code Spell Checker extension, which creates lightbulb, to open lightbulb context menu and choose glean action.

aeciorc commented 4 years ago

@vfonic I've noticed that if there are multiple actions and one of them is preferred, the lightbulb appears blue and near the line of code corresponding to that action, rather than above the selected chunk of code. At first this made me think that it was not appearing at all. Maybe the same thing is happening in your case?

vfonic commented 4 years ago

@aeciorc no, I'm pretty sure the lightbulb sometimes doesn't appear at all.

I usually see (blue or yellow) lightbulb only if there's something else that can open that context menu. Are you sure the same is not happening in your case?

borislit commented 4 years ago

guys just a short update. Im on a short vacation. Ill try to help in a week or so when im back

yyynnn commented 4 years ago

Not working for me too. What the point to inject this functionality into bulb? Better to add it into the command palette.

borislit commented 4 years ago

@yyynnn this is aligned with the rest of VSCode. Code actions that are context based (i.e appear when relevant) should be in the lightbulb menu. Code pallet commands appear no matter what.

Guys, @vfonic @aeciorc Just to be clear - does it work with the lightbulb? If so - this is as intended and is aligned with VSCode guidelines. @vfonic I've noticed that u are trying to select a something that extends a non-Component class. Im guessing that this is the issue since glean checks the parent of a selected class to see if its a component. Can u please check?

vfonic commented 4 years ago

Thank you, sir!

It works with the lightbulb. But it seems like Glean doesn't trigger the lightbulb appearance. I think that's the main issue. So, if there's something else triggering the lightbulb, I can get the action by clicking on the lightbulb. Otherwise, I'm stuck with no lightbulb.

borislit commented 4 years ago

@vfonic Gocha! Ill try to reproduce

vfonic commented 4 years ago

I do agree with @yyynnn, since this seems like something that would be much faster when available from the command menu. I've seen many other extensions easily add things to command menu, that are definitely context-only. Is there some way to give the user the possibility to choose whether or not he wants to be able to kick off this action from the command menu? Maybe some macro or something. I'm not 100% sure how it all works together under the hood.

borislit commented 4 years ago

I see what you mean. But wont it be weird to keep checking in the command pallet whether an option has appear or not? Maybe what would be better is just allow configuring hot keys for each action? So lets say once u have selected your class component you'd just press cmd + f or something and wolla. WYDT?

vfonic commented 4 years ago

Yes! If that's possible, that would be perfect!

On Thu, Nov 14, 2019, 09:52 Boris Litvinsky notifications@github.com wrote:

I see what you mean. But wont it be weird to keep checking in the command pallet whether an option has appear or not? Maybe what would be better is just allow configuring hot keys for each action? So lets say once u have selected your class component you'd just press cmd + f or something and wolla. WYDT?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wix/vscode-glean/issues/84?email_source=notifications&email_token=AAAQO3PCZ6UN3BG2NEI5XDTQTUGTFA5CNFSM4I7KCOAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEBCEZY#issuecomment-553788007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQO3PKYFB7GOC3QJPUK43QTUGTFANCNFSM4I7KCOAA .

borislit commented 4 years ago

@vfonic a small updated - i haven't forgotten about that your suggestion with the hot keys and plan to include in the next release!

iaarnio commented 4 years ago

In my case I also had Eslint extension (dbaeumer.vscode-eslint) active and possibly it's lightbulb was overriding Glean lightbulb (as file had also linting problems).

Glean lightbulb became visible after disabling Eslint extension. Sure in the long run I would like to keep them both enabled.

Nantris commented 1 year ago

It would be really nice if this was addressed after all these years. Glean does NOTHING on my machine (besides lead me on wild goose chases for features that cannot be accessed.)