GordonSmith / vscode-ojs

VS Code extension for ObservableHQ notebooks
https://marketplace.visualstudio.com/items?itemName=GordonSmith.observable-js
MIT License
58 stars 5 forks source link

command 'ojs.import' not found #35

Closed rudifa closed 2 years ago

rudifa commented 2 years ago

Hello @GordonSmith, I just installed your Observable JS into my VSCode, created in the current directory a file, hexagonal-grids.ojs, and tried to import a notebook with OJS: Import notebook, but all I get is this error

Screenshot 2021-10-19 at 20 51 47

What am I missing here?

Thanks, @rudifa

GordonSmith commented 2 years ago

I just tested locally (windows) and it worked as expected.

Typically you get the above error if the extension has not been activated - but given you had opened an OJS file, it should have activated...

Did you open the (empty) hexagonal-grids.ojs file in VSCode? When you import a notebook it imports into the active file.

GordonSmith commented 2 years ago

See the animated gif here: https://github.com/GordonSmith/vscode-ojs/raw/HEAD/images/ojsDemo.gif

rudifa commented 2 years ago

Hi @GordonSmith, thank you for the clarification:

  1. solved: When you import a notebook it imports into the active file. which I did not think of doing, in my first attempts. Perhaps that severe alert should say: Did you open a new .ojs or .omd file in the vscode editor?

  2. On the Mac, I have to press Cmd+K V to preview notebook. (Mac has Ctrl, Alt and Cmd keys; usually we have to use Cmd where Windows uses Ctrl; I don't know about Linux).

So, I'd suggest you to touch up the instructions:

Quick Start with Observable JavaScript | Markdown

1. Create a new file with either the .ojs or .omd extension and open it in the Editor.
...
4. Press Ctrl+K V to preview notebook (press Cmd+K V on a Mac).

Cheers @rudifa

GordonSmith commented 2 years ago

FWIW I have fixed the import issue and updated the readme

rudifa commented 2 years ago

Cool, thank you

@rudifa

On Thu, Oct 28, 2021 at 8:42 AM Gordon Smith @.***> wrote:

FWIW I have fixed the import issue and updated the readme

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GordonSmith/vscode-ojs/issues/35#issuecomment-953547372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABKC5BVRXT4GHRDUSRGXHLUJD5E3ANCNFSM5GJ3Q3AQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.