UNPKG

jupyter-lab-parinfer

Version:
3 lines 1.25 kB
var window=global;var $CLJS=require("./cljs_env");require("./goog.base.js");require("./cljs.core.js");require("./shadow.js.shim.module$$jupyterlab$notebook.js");require("./shadow.js.shim.module$$jupyterlab$cells.js");require("./shadow.js.shim.module$parinfer_codemirror.js"); var rf=function(a){a=a.model;return $CLJS.C(a)?$CLJS.Nb.b(a.defaultKernelLanguage,"clojure"):null},mf=function(a){a=a.editor.editor;var b=a.__parinfer__;return null==b||!1===b?$CLJS.lf.init(a):null},nf=function(a){if($CLJS.C(rf(a))){a=$CLJS.O(a.widgets);for(var b=null,c=0,d=0;;)if(d<c){var e=b.V(null,d);mf(e);d+=1}else if(a=$CLJS.O(a))b=a,$CLJS.ec(b)?(a=$CLJS.we(b),c=$CLJS.xe(b),b=a,e=$CLJS.V(a),a=c,c=e):(e=$CLJS.T(b),mf(e),a=$CLJS.U(b),b=null,c=0),d=0;else return null}else return null},of=function(a, b){return $CLJS.C(b)?b.content.modelContentChanged.connect(nf):null},pf=function(a,b){a=a.currentWidget;$CLJS.C(a)?($CLJS.C(b)?(a=rf(a),a=$CLJS.C(a)?$CLJS.Nb.b(null==b?null:b.constructor,$CLJS.kf.CodeCell):a):a=b,b=$CLJS.C(a)?mf(b):null):b=null;return b},qf=function(a,b){b.currentChanged.connect(of);return b.activeCellChanged.connect(pf)};module.exports={activate:qf,extension:{id:"jupyter-lab-parinfer",autoStart:!0,requires:[$CLJS.jf.INotebookTracker],activate:qf}};