jupyterlab-variableInspector icon indicating copy to clipboard operation
jupyterlab-variableInspector copied to clipboard

How should extension inspector scripts be created for new languages?

Open gerph opened this issue 3 years ago • 3 comments

Hiya,

I've created a new kernel for a pair of 'languages' that I want to use. I want to use variable inspector with these new languages, but the only way I can see to do that is to directly modify the commands that are in the inspectorscripts.ts file and provide new parser code for this. I cannot see a way to do this without essentially forking this project and adding the necessary code to my own fork.

Is there a way to extend the languages supported through an extension instead of by forking the project and directly modifying it?

gerph avatar Apr 04 '21 16:04 gerph

Hey, you're right, at the moment one would have to modify the code in inspectorscripts.ts. A better approach would be to add language scripts in a separate directory. I will investigate if this would work with the way the packge is build and distributed at the moment.

lckr avatar Apr 10 '21 13:04 lckr

If someone has time to tackle this, one would have to to the following:

  • Create separate directory for language scripts
  • Parse existing scripts at start up
  • If kernel with language L is connected to the extension: Check if there is an available script that we can use.

lckr avatar Apr 10 '21 13:04 lckr

Why not create your own custom COMM target so the the support can be contained in the kernel? Inspection would be done via COMM messages.

yitzchak avatar Jun 08 '21 16:06 yitzchak