Closed GordonSmith closed 2 years ago
@GordonSmith you just need to add your OJS import command to activationEvents
in package.json, like so:
"activationEvents": [
...
"onCommand:ojs.import"
],
this might require creating new Untitled OJS document, or you can specify when that command runs, i.e. for open OJS files only.
Altrnatively, you can make sure OJS Import command never shows in Command Palette. Example:
https://github.com/RandomFractals/vscode-snippets-viewer/blob/main/package.json#L161
"commandPalette": [
{
"command": "ojs.import",
"when": "never"
},
...]
That way users will be forced to created new .ojs or .omd file to run Observable notebook import command :slightly_smiling_face:
@pmunin I think you should revise your review.
Docs clearly state how to import OJS notebooks: https://github.com/GordonSmith/vscode-ojs#quick-start-with-observable-javascript--markdown
Also, VS Marketplace reviews are not for logging issues.
Gordon created great extension that makes it possible to run Observable notebooks in vscode, one of a kind.
Resolved
If no ojs or omd files have been loaded previously (or none are in focus) and the user tries to "import file" it will fail.
FYI @pmunin