rlivings39 / vscode-fzf-quick-open

vscode extension providing quick file/folder open and searching using fzf
MIT License
77 stars 17 forks source link

No `fzf-quick-open` commands can be found. #27

Closed djsavvy closed 3 years ago

djsavvy commented 3 years ago

I'm using latest VSCode on latest Windows 10.

Whenever I try to run a fzf-quick-open command, I get the following error: image

I have all three of fd, rg, and fzf in my path, and I'm not sure what else I might have done wrong. Weirdly, the "feature contributions" tab of this extension on VSCode seems to indicate that several commands are added by this plugin, but I can't use any of them.

rlivings39 commented 3 years ago

That's odd. It definitely looks like the extension failed to load commands. Which version of the extension do you have installed?

An idea:

If that doesn't work, I'll think through some other debugging steps.

djsavvy commented 3 years ago

Thanks for the quick response. I've got version 0.4.1 of fzf-quick-open. Here's my "About VSCode": image

I tried deleting that folder and reinstalling, but I've got the same problem still.

rlivings39 commented 3 years ago

OK thanks for trying and the info. It looks like in the extension code, we try to set up some pipes and only then register the commands:

https://github.com/rlivings39/vscode-fzf-quick-open/blob/master/src/extension.ts#L233

It could be that one of those is erroring out and stopping the command registration. If you reproduce the error and then do: Ctrl+Shift+P Developer: Show logs... and then pick Extension Host is there anything related to this extension? If I manually hack that code to throw at line 235 I see:

[2021-04-27 16:38:14.650] [exthost] [error] Activating extension rlivings39.fzf-quick-open failed due to an error:
[2021-04-27 16:38:14.650] [exthost] [error] Blaaaaaaah

If not, I may need to add some logging and push a new version.

oessaid commented 3 years ago

Hi @rlivings39, I've run into the same issue and here's the relevant output from the logs (is it readable enough?):

image

So I've had a look at the culprit, it turns out it's an uncaught error in applyConfig. Basically, when the term variable is Null, trying to access the toLowerCase() method fails. I've added a ? behind term to catch it:

let isWindowsCmd = term?.toLowerCase().endsWith("cmd.exe")

Now the previous line

let term = vscode.workspace.getConfiguration('terminal.integrated.shell').get('windows');

returns Null, but it really shouldn't as I'm on Windows and running the default VSCode settings as it comes to the shell. My workaround was to manually set that in the settings JSON, preventing the term variable from returning Null:

"terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"

I still think the error should be caught, though.

Edit: a typo

rlivings39 commented 3 years ago

@oessaid, thanks for the help! This is fixed and will be released in 0.4.2