LogtalkDotOrg / logtalk-for-vscode

Logtalk for VSCode extension
MIT License
5 stars 0 forks source link

Support running load commands from command palette/keybindings #3

Closed cl-alexk closed 7 months ago

cl-alexk commented 7 months ago

The suggested way to load file/directory is to right-click and invoke the command from the context menu. Took me a day to figure out why I couldn't load file from command palette and was running into Cannot read properties of undefined (reading 'fsPath') issue instead.

I'm not a JS/VSCode developer, but it appears that commands invoked from palette/keybinding don't receive a uri in their callback, meaning this only works from the context menu, which is unfortunate.

I see @arthwang had it this way in his original script. Curiously, in his Prolog extension he used a mechanism that does not depend on context, this might be a useful fallback when uri is undefined.

https://github.com/arthwang/vsc-prolog/blob/master/src/features/prologTerminal.ts#L57

pmoura commented 7 months ago

Hopefully fixed in the latest version, 0.9.3.

cl-alexk commented 7 months ago

This is amazing turnaround and I can confirm it's working, thank you!

pmoura commented 7 months ago

P.S. The extension is now available from the Marketplace. https://marketplace.visualstudio.com/items?itemName=LogtalkDotOrg.logtalk-for-vscode&ssr=false#user-content-configuration

cl-alexk commented 7 months ago

Thank you!