GordonSmith/vscode-ojs

command 'ojs.import' not found

rudifa opened this issue · 5 comments

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

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.

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

FWIW I have fixed the import issue and updated the readme