├── .gitignore ├── README.adoc ├── atom ├── .gitignore ├── README.adoc ├── bin │ └── .keep ├── docs │ └── Hacking.md ├── lib │ ├── .keep │ └── main.js ├── menus │ └── adorn.cson ├── package-lock.json ├── package.json ├── shadow-cljs.edn └── src │ └── adorn │ ├── atom.cljs │ ├── core.cljs │ ├── dispose.cljs │ └── jsonrpc.cljs ├── deps.edn ├── emacs ├── README.adoc ├── adorn.el └── bin │ └── .keep ├── src └── script.clj └── vscode ├── .gitignore ├── .vscode └── launch.json ├── README.adoc ├── bin └── .keep ├── lib ├── .keep └── main.js ├── package-lock.json ├── package.json ├── shadow-cljs.edn └── src └── adorn ├── core.cljs ├── jsonrpc.cljs └── vscode.cljs /.gitignore: -------------------------------------------------------------------------------- 1 | .cpcache 2 | classes 3 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = Adorn Helper Program and Friends 2 | 3 | This project is an experiment in testing the feasibility of providing additional functionality to various Clojure-supporting editors without adding to existing Clojure tooling (e.g. Cider, Chlorine, Calva, etc.) and further provide a path for such existing tooling to spin out some of their functionality. 4 | 5 | Note that the primary purpose of this repository is a demonstration of HOW some functionality might be provided and not necessarily WHAT. 6 | 7 | == Rationale 8 | 9 | Some existing Clojure-supporting editor tooling seem to struggle with accumulating additional features. On the one hand it's convenient to have many features built-in, on the other hand, this can make maintenance, extension, and learning of the existing code bases increasingly difficult as more functionality is added over time. 10 | 11 | Recent developments such as https://www.graalvm.org/docs/reference-manual/aot-compilation/[GraalVM Native Image], https://github.com/anmonteiro/lumo[Lumo], and https://openjdk.java.net/jeps/295[jaotc] might offer the possibility of providing quick-to-launch external programs that can provide some Clojure-related manipulation independent of other tooling. 12 | 13 | In the Clojure spirit of à la carte and decomplecting, perhaps it's practical for some functionality (e.g. some types of refactoring) to live separated from other functionality (e.g. jump-to-defintion based on static analysis). (Note that REPL-dependent functionality is not currently being considered.) 14 | 15 | == Architecture 16 | 17 | The basic idea is to implement most of the desired functionality in an external Clojure program, called a "helper", and then have a thin wrapper (per supported editor) that communicates with this helper. 18 | 19 | This should enable simpler editor-specific implementations, allow the external Clojure program to manipulate and execute Clojure code, as well as reduce the amount of code one might otherwise need to reimplement within each editor-specific implementation. 20 | 21 | == Prerequisites 22 | 23 | * Some Java (using >= 8 here) 24 | * https://www.graalvm.org/docs/reference-manual/aot-compilation/#install-native-image[Native Image] (implies appropriate https://github.com/oracle/graal[GraalVM] >= 19) 25 | * Clojure 1.9 and its clj tool 26 | * Atom, Emacs, or VSCode 27 | 28 | == Building and Setup 29 | 30 | * Clone this repository and cd to the clone 31 | 32 | * Ensure native-image is on your PATH -OR- + 33 | Set GRAALVM_HOME appropriately (e.g. on Arch Linux this might be /usr/lib/jvm/java-8-graal) 34 | 35 | * Build the helper: `clj -A:native-image`. After some time, this should produce a file named "adorn" in the current directory. 36 | 37 | * Examine the atom / emacs / vscode subdirectory and follow the contained instructions for getting the Atom plugin / Emacs package / VSCode extension to work 38 | 39 | == Technical Details 40 | 41 | Initially, the helper will be created using Native Image. Note that Native Image appears to have a variety of https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md[limitations] so it might be worth trying Lumo and/or jaotc at some point. 42 | 43 | Communication between a wrapper and the helper could be done in a variety of ways, but the initial choice is to talk via STDIN / STDOUT and exchange JSON RPC strings. (EDN was also considered, but support for generating it appeared to be weak in at least one commonly used editor.) 44 | 45 | The first editors chosen for support are Atom, Emacs, and VSCode. (It should be fairly straight-forward to create a wrapper for any editor that can read / write JSON and work with external processes.) 46 | 47 | == Acknowledgments 48 | 49 | Thanks to (at least) the following folks: 50 | 51 | * borkdude 52 | * lread 53 | * mauricioszabo 54 | * rundis 55 | * Saikyun 56 | * seancorfield 57 | * taylorwood 58 | * thheller 59 | * xsc 60 | -------------------------------------------------------------------------------- /atom/.gitignore: -------------------------------------------------------------------------------- 1 | out/ 2 | node_modules/ 3 | 4 | .shadow-cljs 5 | -------------------------------------------------------------------------------- /atom/README.adoc: -------------------------------------------------------------------------------- 1 | = Adorn Atom Plugin 2 | 3 | == Prerequisites 4 | 5 | * Adorn command line program built 6 | * Atom 7 | * npm 8 | * A sacrificial / backed-up Clojure project directory 9 | 10 | == Building 11 | 12 | * In some terminal: 13 | 14 | ---- 15 | # install dependencies 16 | npm install 17 | # build + watch for changes 18 | npx shadow-cljs watch dev 19 | ---- 20 | 21 | If all went well, there should now be a fresh file at lib/main.js (the "compiled" plugin). 22 | 23 | * In the bin subdirectory, make a copy of the adorn binary, or create a symlink to it. 24 | 25 | == Starting 26 | 27 | * Symlink the directory containing this file under ~/.atom/packages/ 28 | 29 | * Start Atom 30 | 31 | * Open a folder that has at least one Clojure file in it. 32 | 33 | == Invoking 34 | 35 | * Open a Clojure file in an editor pane and move the cursor to somewhere within a defn form. 36 | 37 | * Bring up the https://flight-manual.atom.io/getting-started/sections/atom-basics/#command-palette[command palette], look for / start typing "Inline Def", and once found / selected, press Enter / Return. 38 | 39 | * This should result in an https://blog.michielborkent.nl/2017/05/25/inline-def-debugging/[Inline Def] transformation being applied to the defn. 40 | -------------------------------------------------------------------------------- /atom/bin/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sogaiu/adorn/2cc6712810c2a6dc7a02c24a5cc5951266e2e786/atom/bin/.keep -------------------------------------------------------------------------------- /atom/docs/Hacking.md: -------------------------------------------------------------------------------- 1 | # Developing 2 | 3 | Run the following commands in the current directory: 4 | 5 | ```shell 6 | yarn 7 | yarn shadow-cljs watch dev 8 | ``` 9 | 10 | This will start up a compiler for ClojureScript. Symlinking this directory under `~/.atom/packages/` is convenient for development. The symlink may need to be named "adorn". 11 | 12 | Please note that Adorn activates via its "inline-def" command. 13 | 14 | Once Adorn is activated, connect to a cljs repl by: 15 | 16 | ```shell 17 | yarn shadow-cljs cljs-repl dev 18 | ``` 19 | 20 | Atom's devtools console may be helpful from time to time as well. 21 | -------------------------------------------------------------------------------- /atom/lib/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sogaiu/adorn/2cc6712810c2a6dc7a02c24a5cc5951266e2e786/atom/lib/.keep -------------------------------------------------------------------------------- /atom/lib/main.js: -------------------------------------------------------------------------------- 1 | var shadow$provide = {}; 2 | (function(root, factory) { 3 | if (typeof define === "function" && define.amd) { 4 | define([], factory); 5 | } else if (typeof module === "object" && module.exports) { 6 | module.exports = factory(); 7 | } else { 8 | root.returnExports = factory(); 9 | } 10 | })(this, function() { 11 | var shadow$umd$export = null; 12 | var f; 13 | function r(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"== 14 | b&&"undefined"==typeof a.call)return"object";return b}var aa="closure_uid_"+(1E9*Math.random()>>>0),ba=0;function ca(a){var b=a.length;if(0>>16&65535)*d+c*(b>>>16&65535)<<16>>>0)|0};function vb(a){a=ub(a|0,-862048943);return ub(a<<15|a>>>-15,461845907)}function wb(a,b){a=(a|0)^(b|0);return ub(a<<13|a>>>-13,5)+-430675100|0}function xb(a,b){a=(a|0)^b;a=ub(a^a>>>16,-2048144789);a=ub(a^a>>>13,-1028477387);return a^a>>>16} 37 | function yb(a){a:{var b=1;for(var c=0;;)if(b>2)} 39 | function Eb(a,b,c,d,e){this.Za=a;this.name=b;this.ua=c;this.Pa=d;this.ma=e;this.f=2154168321;this.o=4096}f=Eb.prototype;f.toString=function(){return this.ua};f.D=function(a,b){return b instanceof Eb?this.ua===b.ua:!1}; 40 | f.call=function(){function a(d,e,g){return G.g?G.g(e,this,g):G.call(null,e,this,g)}function b(d,e){return G.b?G.b(e,this):G.call(null,e,this)}var c=null;c=function(d,e,g){switch(arguments.length){case 2:return b.call(this,d,e);case 3:return a.call(this,d,e,g)}throw Error("Invalid arity: "+(arguments.length-1));};c.b=b;c.g=a;return c}();f.apply=function(a,b){return this.call.apply(this,[this].concat(ya(b)))};f.a=function(a){return G.b?G.b(a,this):G.call(null,a,this)}; 41 | f.b=function(a,b){return G.g?G.g(a,this,b):G.call(null,a,this,b)};f.H=function(){return this.ma};f.P=function(a,b){return new Eb(this.Za,this.name,this.ua,this.Pa,b)};f.G=function(){var a=this.Pa;return null!=a?a:this.Pa=a=Db(yb(this.name),Bb(this.Za))};f.I=function(a,b){return F(b,this.ua)};var Fb=function Fb(a){switch(arguments.length){case 1:return Fb.a(arguments[0]);case 2:return Fb.b(arguments[0],arguments[1]);default:throw Error(["Invalid arity: ",z.a(arguments.length)].join(""));}}; 42 | Fb.a=function(a){for(;;){if(a instanceof Eb)return a;if("string"===typeof a){var b=a.indexOf("/");return 1>b?Fb.b(null,a):Fb.b(a.substring(0,b),a.substring(b+1,a.length))}if(a instanceof I)a=a.qa;else throw Error("no conversion to symbol");}};Fb.b=function(a,b){var c=null!=a?[z.a(a),"/",z.a(b)].join(""):b;return new Eb(a,b,c,null,null)};Fb.K=2;function Gb(a){return null!=a?a.o&131072||u===a.Sb?!0:a.o?!1:w(qb,a):w(qb,a)} 43 | function J(a){if(null==a)return null;if(null!=a&&(a.f&8388608||u===a.Hb))return a.F(null);if(Array.isArray(a)||"string"===typeof a)return 0===a.length?null:new K(a,0,null);if(null!=a&&null!=a[xa])return a=(null!==a&&xa in a?a[xa]:void 0).call(a),Hf.a?Hf.a(a):Hf.call(null,a);if(w(bb,a))return cb(a);throw Error([z.a(a)," is not ISeqable"].join(""));}function N(a){if(null==a)return null;if(null!=a&&(a.f&64||u===a.La))return a.aa(null);a=J(a);return null==a?null:D(a)} 44 | function Hb(a){return null!=a?null!=a&&(a.f&64||u===a.La)?a.ba(null):(a=J(a))?a.ba(null):O:O}function P(a){return null==a?null:null!=a&&(a.f&128||u===a.Ta)?a.V():J(Hb(a))}var Q=function Q(a){switch(arguments.length){case 1:return Q.a(arguments[0]);case 2:return Q.b(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e=d)return-1;!(0c&&(c+=d,c=0>c?0:c);for(;;)if(cc?d+c:c;for(;;)if(0<=c){if(Q.b(Wb?Wb(a,c):Xb.call(null,a,c),b))return c;--c}else return-1}function Yb(a,b){this.c=a;this.i=b}Yb.prototype.ca=function(){return this.ia?0:a};f.G=function(){return Kb(this)};f.D=function(a,b){return Zb.b?Zb.b(this,b):Zb.call(null,this,b)};f.U=function(){return O};f.X=function(a,b){return Tb(this.c,b,this.c[this.i],this.i+1)};f.Y=function(a,b,c){return Tb(this.c,b,c,this.i)};f.aa=function(){return this.c[this.i]}; 54 | f.ba=function(){return this.i+1b)throw Error("Index out of bounds");a:for(;;){if(null==a)throw Error("Index out of bounds"); 60 | if(0===b){if(J(a)){a=N(a);break a}throw Error("Index out of bounds");}if(Vb(a)){a=B(a,b);break a}if(J(a))a=P(a),--b;else throw Error("Index out of bounds");}return a}if(w(Ia,a))return B(a,b);throw Error(["nth not supported on this type ",z.a(wa(null==a?null:a.constructor))].join(""));} 61 | function W(a,b,c){if("number"!==typeof b)throw Error("Index argument to nth must be a number.");if(null==a)return c;if(null!=a&&(a.f&16||u===a.mb))return a.fa(null,b,c);if(Array.isArray(a))return-1b?c:ec(a,b,c);if(w(Ia,a))return B(a,b,c);throw Error(["nth not supported on this type ",z.a(wa(null==a?null:a.constructor))].join(""));} 62 | var G=function G(a){switch(arguments.length){case 2:return G.b(arguments[0],arguments[1]);case 3:return G.g(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",z.a(arguments.length)].join(""));}};G.b=function(a,b){return null==a?null:null!=a&&(a.f&256||u===a.Ab)?a.ga(null,b):Array.isArray(a)?null!=b&&b>1&1431655765;a=(a&858993459)+(a>>2&858993459);return 16843009*(a+(a>>4)&252645135)>>24}var z=function z(a){switch(arguments.length){case 0:return z.A();case 1:return z.a(arguments[0]);default:for(var c=[],d=arguments.length,e=0;;)if(ea?0:a-1>>>5<<5}function ld(a,b,c){for(;;){if(0===b)return c;var d=jd(a);d.c[0]=c;c=d;b-=5}}var md=function md(a,b,c,d){var g=new id(c.Jb,ya(c.c)),h=a.h-1>>>b&31;5===b?g.c[h]=d:(c=c.c[h],null!=c?(b-=5,a=md.N?md.N(a,b,c,d):md.call(null,a,b,c,d)):a=ld(null,b-5,d),g.c[h]=a);return g}; 134 | function nd(a,b){if(b>=kd(a))return a.$;var c=a.root;for(a=a.shift;;)if(0>>a&31];a=d}else return c.c}function od(a,b){if(0<=b&&b>>b&31;b-=5;c=c.c[k];a=pd.pa?pd.pa(a,b,c,d,e):pd.call(null,a,b,c,d,e);h.c[k]=a}return h}; 135 | function qd(a,b,c){this.eb=this.i=0;this.c=a;this.Lb=b;this.start=0;this.end=c}qd.prototype.ca=function(){return this.i=this.h)return new K(this.$,0,null);a:{var a=this.root;for(var b=this.shift;;)if(0this.h-kd(this)){a=this.$.length;for(var c=Array(a+1),d=0;;)if(d>>5>1<>>b&31;if(5===b)a=d;else{var h=c.c[g];null!=h?(b-=5,a=Bd.N?Bd.N(a,b,h,d):Bd.call(null,a,b,h,d)):a=ld(a.root.Jb,b-5,d)}c.c[g]=a;return c}; 154 | function td(a,b,c,d){this.h=a;this.shift=b;this.root=c;this.$=d;this.o=88;this.f=275}f=td.prototype; 155 | f.Ua=function(a,b){if(this.root.Jb){if(32>this.h-kd(this))this.$[this.h&31]=b;else{a=new id(this.root.Jb,this.$);var c=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];c[0]=b;this.$=c;this.h>>>5>1<>>g&31;g=k(g-5,h.c[l]);h.c[l]=g}return h}(a.shift,a.root);a.root=d}return a}if(b===a.h)return a.Ua(null,c);throw Error(["Index ",z.a(b)," out of bounds for TransientVector of length",z.a(a.h)].join(""));}throw Error("assoc! after persistent!");}f.T=function(){if(this.root.Jb)return this.h;throw Error("count after persistent!");}; 159 | f.O=function(a,b){if(this.root.Jb)return od(this,b)[b&31];throw Error("nth after persistent!");};f.fa=function(a,b,c){return 0<=b&&bb?4:2*(b+1));rc(this.c,0,c,0,2*b);return new ae(a,this.M,c)};f.Wa=function(){return be?be(this.c):ce.call(null,this.c)};f.Xa=function(a,b){return Zd(this.c,a,b)};f.Na=function(a,b,c,d){var e=1<<(b>>>a&31);if(0===(this.M&e))return d;var g=Dc(this.M&e-1);e=this.c[2*g];g=this.c[2*g+1];return null==e?g.Na(a+5,b,c,d):Vd(c,e)?g:d}; 187 | f.ia=function(a,b,c,d,e,g){var h=1<<(c>>>b&31),k=Dc(this.M&h-1);if(0===(this.M&h)){var l=Dc(this.M);if(2*l>>b&31]=de.ia(a,b+5,c,d,e,g);for(e=d=0;;)if(32>d)0===(this.M>>>d&1)? 188 | d+=1:(k[d]=null!=this.c[e]?de.ia(a,b+5,Cb(this.c[e]),this.c[e],this.c[e+1],g):this.c[e+1],e+=2,d+=1);else break;return new ee(a,l+1,k)}b=Array(2*(l+4));rc(this.c,0,b,0,2*k);b[2*k]=d;b[2*k+1]=e;rc(this.c,2*k,b,2*(k+1),2*(l-k));g.C=!0;a=this.Ma(a);a.c=b;a.M|=h;return a}l=this.c[2*k];h=this.c[2*k+1];if(null==l)return l=h.ia(a,b+5,c,d,e,g),l===h?this:Xd(this,a,2*k+1,l);if(Vd(d,l))return e===h?this:Xd(this,a,2*k+1,e);g.C=!0;g=b+5;d=fe?fe(a,g,l,h,c,d,e):ge.call(null,a,g,l,h,c,d,e);e=2*k;k=2*k+1;a=this.Ma(a); 189 | a.c[e]=null;a.c[k]=d;return a}; 190 | f.ha=function(a,b,c,d,e){var g=1<<(b>>>a&31),h=Dc(this.M&g-1);if(0===(this.M&g)){var k=Dc(this.M);if(16<=k){h=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];h[b>>>a&31]=de.ha(a+5,b,c,d,e);for(d=c=0;;)if(32>c)0===(this.M>>>c&1)?c+=1:(h[c]=null!=this.c[d]?de.ha(a+5,Cb(this.c[d]),this.c[d],this.c[d+1],e):this.c[d+1],d+=2,c+=1);else break;return new ee(null,k+1,h)}a=Array(2*(k+1));rc(this.c, 191 | 0,a,0,2*h);a[2*h]=c;a[2*h+1]=d;rc(this.c,2*h,a,2*(h+1),2*(k-h));e.C=!0;return new ae(null,this.M|g,a)}var l=this.c[2*h];g=this.c[2*h+1];if(null==l)return k=g.ha(a+5,b,c,d,e),k===g?this:new ae(null,this.M,Wd(this.c,2*h+1,k));if(Vd(c,l))return d===g?this:new ae(null,this.M,Wd(this.c,2*h+1,d));e.C=!0;e=this.M;k=this.c;a+=5;a=he?he(a,l,g,b,c,d):ge.call(null,a,l,g,b,c,d);c=2*h;h=2*h+1;d=ya(k);d[c]=null;d[h]=a;return new ae(null,e,d)};f.na=function(){return new $d(this.c)};var de=new ae(null,0,[]); 192 | function ie(a){this.c=a;this.i=0;this.ka=null}ie.prototype.ca=function(){for(var a=this.c.length;;){if(null!=this.ka&&this.ka.ca())return!0;if(this.i>>a&31];return null!=e?e.Na(a+5,b,c,d):d}; 194 | f.ia=function(a,b,c,d,e,g){var h=c>>>b&31,k=this.c[h];if(null==k)return a=Xd(this,a,h,de.ia(a,b+5,c,d,e,g)),a.h+=1,a;b=k.ia(a,b+5,c,d,e,g);return b===k?this:Xd(this,a,h,b)};f.ha=function(a,b,c,d,e){var g=b>>>a&31,h=this.c[g];if(null==h)return new ee(null,this.h+1,Wd(this.c,g,de.ha(a+5,b,c,d,e)));a=h.ha(a+5,b,c,d,e);return a===h?this:new ee(null,this.h,Wd(this.c,g,a))};f.na=function(){return new ie(this.c)};function le(a,b,c){b*=2;for(var d=0;;)if(da?d:Vd(c,this.c[a])?this.c[a+1]:d}; 196 | f.ia=function(a,b,c,d,e,g){if(c===this.ta){b=le(this.c,this.h,d);if(-1===b){if(this.c.length>2*this.h)return b=2*this.h,c=2*this.h+1,a=this.Ma(a),a.c[b]=d,a.c[c]=e,g.C=!0,a.h+=1,a;c=this.c.length;b=Array(c+2);rc(this.c,0,b,0,c);b[c]=d;b[c+1]=e;g.C=!0;d=this.h+1;a===this.Jb?(this.c=b,this.h=d,a=this):a=new me(this.Jb,this.ta,d,b);return a}return this.c[b+1]===e?this:Xd(this,a,b+1,e)}return(new ae(a,1<<(this.ta>>>b&31),[null,this,null,null])).ia(a,b,c,d,e,g)}; 197 | f.ha=function(a,b,c,d,e){return b===this.ta?(a=le(this.c,this.h,c),-1===a?(a=2*this.h,b=Array(a+2),rc(this.c,0,b,0,a),b[a]=c,b[a+1]=d,e.C=!0,new me(null,this.ta,this.h+1,b)):Q.b(this.c[a+1],d)?this:new me(null,this.ta,this.h,Wd(this.c,a+1,d))):(new ae(null,1<<(this.ta>>>a&31),[null,this])).ha(a,b,c,d,e)};f.na=function(){return new $d(this.c)}; 198 | function ge(a){switch(arguments.length){case 6:return he(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);case 7:return fe(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]);default:throw Error(["Invalid arity: ",z.a(arguments.length)].join(""));}}function he(a,b,c,d,e,g){var h=Cb(b);if(h===d)return new me(null,h,2,[b,c,e,g]);var k=new Ud;return de.ha(a,h,b,c,k).ha(a,d,e,g,k)} 199 | function fe(a,b,c,d,e,g,h){var k=Cb(c);if(k===e)return new me(null,k,2,[c,d,g,h]);var l=new Ud;return de.ia(a,b,k,c,d,l).ia(a,b,e,g,h,l)}function ne(a,b,c,d,e){this.l=a;this.la=b;this.i=c;this.u=d;this.m=e;this.f=32374988;this.o=0}f=ne.prototype;f.toString=function(){return tb(this)}; 200 | f.indexOf=function(){var a=null;a=function(b,c){switch(arguments.length){case 1:return S(this,b,0);case 2:return S(this,b,c)}throw Error("Invalid arity: "+arguments.length);};a.a=function(b){return S(this,b,0)};a.b=function(b,c){return S(this,b,c)};return a}(); 201 | f.lastIndexOf=function(){function a(c){return U(this,c,T(this))}var b=null;b=function(c,d){switch(arguments.length){case 1:return a.call(this,c);case 2:return U(this,c,d)}throw Error("Invalid arity: "+arguments.length);};b.a=a;b.b=function(c,d){return U(this,c,d)};return b}();f.H=function(){return this.l};f.V=function(){if(null==this.u){var a=this.la,b=this.i+2;return oe?oe(a,b,null):ce.call(null,a,b,null)}a=this.la;b=this.i;var c=P(this.u);return oe?oe(a,b,c):ce.call(null,a,b,c)}; 202 | f.G=function(){var a=this.m;return null!=a?a:this.m=a=Kb(this)};f.D=function(a,b){return Zb(this,b)};f.U=function(){return O};f.X=function(a,b){return vc(b,this)};f.Y=function(a,b,c){return wc(b,c,this)};f.aa=function(){return null==this.u?new Id(this.la[this.i],this.la[this.i+1]):N(this.u)}; 203 | f.ba=function(){var a=this,b=null==a.u?function(){var c=a.la,d=a.i+2;return oe?oe(c,d,null):ce.call(null,c,d,null)}():function(){var c=a.la,d=a.i,e=P(a.u);return oe?oe(c,d,e):ce.call(null,c,d,e)}();return null!=b?b:O};f.F=function(){return this};f.P=function(a,b){return b===this.l?this:new ne(b,this.la,this.i,this.u,this.m)};f.S=function(a,b){return V(b,this)};ne.prototype[xa]=function(){return Jb(this)}; 204 | function ce(a){switch(arguments.length){case 1:return be(arguments[0]);case 3:return oe(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",z.a(arguments.length)].join(""));}}function be(a){return oe(a,0,null)}function oe(a,b,c){if(null==c)for(c=a.length;;)if(bna)return F(a,"#");F(a,c);if(0===ua.a(g))J(h)&&F(a,function(){var t=Be.a(g);return v(t)?t:"..."}());else{if(J(h)){var l=N(h);b.g?b.g(l,a,g):b.call(null,l,a,g)}for(var m=P(h),n=ua.a(g)-1;;)if(!m||null!=n&&0===n){J(m)&&0===n&&(F(a,d),F(a,function(){var t=Be.a(g);return v(t)?t:"..."}()));break}else{F(a,d);var p=N(m);c=a;h=g;b.g?b.g(p,c,h):b.call(null,p,c,h);var q=P(m);c=n-1;m=q;n=c}}return F(a,e)}finally{na=k}} 229 | function Ce(a,b){b=J(b);for(var c=null,d=0,e=0;;)if(ek)h=new X(null,k,5,bd,h,null);else for(var l=32,m=(new X(null,32,5,bd,h.slice(0,32),null)).Sa(null);;)if(l=1.0.0 <2.0.0" 11 | }, 12 | "activationCommands": { 13 | "atom-workspace": [ 14 | "adorn:inline-def" 15 | ] 16 | }, 17 | "devDependencies": { 18 | "minimist": "^1.2.6", 19 | "shadow-cljs": "^2.8.93", 20 | "source-map-support": "^0.5.9", 21 | "ws": "^6.2.2" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /atom/shadow-cljs.edn: -------------------------------------------------------------------------------- 1 | ;; shadow-cljs configuration 2 | {:source-paths [ 3 | "lib" 4 | "src" 5 | ] 6 | ;; 7 | :dependencies [] 8 | ;; 9 | :builds 10 | {:dev {:target :node-library 11 | ;; 12 | :compiler-options {:infer-externs :auto} 13 | :exports { 14 | :activate adorn.core/activate 15 | :deactivate adorn.core/deactivate 16 | } 17 | ;; 18 | :output-dir "lib/js" 19 | :output-to "lib/main.js" 20 | :devtools {:before-load-async adorn.core/before}}}} 21 | -------------------------------------------------------------------------------- /atom/src/adorn/atom.cljs: -------------------------------------------------------------------------------- 1 | (ns adorn.atom) 2 | 3 | (defn current-platform 4 | [] 5 | (let [os-type (.type (js/require "os"))] 6 | (case os-type 7 | "Darwin" :darwin 8 | "Linux" :linux 9 | "Windows_NT" :win32))) 10 | 11 | ;; thanks to atom-packages-dependencies 12 | (defn path-for-pkg 13 | [pkg-name] 14 | (->> pkg-name 15 | (.getLoadedPackage (.-packages js/atom)) 16 | (.-mainModulePath))) 17 | 18 | (defn current-workspace 19 | [] 20 | (.getView (.-views js/atom) 21 | (.-workspace js/atom))) 22 | 23 | (defn warn-message 24 | ([title] 25 | (warn-message title "")) 26 | ([title text] 27 | (-> (.-notifications js/atom) 28 | (.addWarning title #js {:detail text})))) 29 | 30 | (defn error-message 31 | ([title] 32 | (error-message title "")) 33 | ([title text] 34 | (-> (.-notifications js/atom) 35 | (.addError title #js {:detail text})))) 36 | 37 | (defn info-message 38 | ([title] 39 | (info-message title "")) 40 | ([title text] 41 | (-> (.-notifications js/atom) 42 | (.addInfo title #js {:detail text})))) 43 | 44 | (defn current-editor [] 45 | (-> (.-workspace js/atom) 46 | .getActiveTextEditor)) 47 | 48 | (defn current-pos 49 | ([] 50 | (current-pos (current-editor))) 51 | ([^js editor] 52 | (let [point (.getCursorBufferPosition editor)] 53 | [(.-row point) (.-column point)]))) 54 | 55 | (defn current-row 56 | ([] 57 | (current-row (current-editor))) 58 | ([^js editor] 59 | (let [[row _] (current-pos editor)] 60 | row))) 61 | 62 | (defn line-at 63 | ([line-no] 64 | (line-at (current-editor) line-no)) 65 | ([^js editor line-no] 66 | (.lineTextForBufferRow editor line-no))) 67 | 68 | (defn current-line 69 | ([] 70 | (current-line (current-editor))) 71 | ([^js editor] 72 | (.lineTextForBufferRow editor (current-row editor)))) 73 | 74 | (defn current-col 75 | ([] 76 | (current-col (current-editor))) 77 | ([^js editor] 78 | (let [[_ col] (current-pos editor)] 79 | col))) 80 | 81 | (defn current-selection 82 | ([] 83 | (current-selection (current-editor))) 84 | ([^js editor] 85 | (.getSelectedText editor))) 86 | 87 | (defn current-buffer 88 | ([] 89 | (current-buffer (current-editor))) 90 | ([^js editor] 91 | (.getText editor))) 92 | 93 | (defn current-path 94 | ([] 95 | (current-path (current-editor))) 96 | ([^js editor] 97 | (.getPath editor))) 98 | 99 | -------------------------------------------------------------------------------- /atom/src/adorn/core.cljs: -------------------------------------------------------------------------------- 1 | (ns adorn.core 2 | (:require [adorn.atom :as aa] 3 | [adorn.dispose :as ad] 4 | [adorn.jsonrpc :as aj])) 5 | 6 | (def cp 7 | (js/require "child_process")) 8 | 9 | (def path 10 | (js/require "path")) 11 | 12 | (def adorn-path 13 | (let [pkg-dir-path (->> (aa/path-for-pkg "adorn") 14 | (.dirname path) 15 | (.dirname path))] 16 | (str pkg-dir-path "/bin/adorn"))) 17 | 18 | (defn inline-def 19 | [] 20 | (aa/info-message "invoking helper...") 21 | (let [p (.spawn cp adorn-path #js [] #js {}) 22 | stdout (.-stdout p) 23 | stdin (.-stdin p)] 24 | ;; receiving response from helper 25 | (.on stdout "data" 26 | (fn [data] 27 | ;; XXX: handle error case 28 | (let [[text text-range] 29 | (get (aj/from-str data) 30 | "result")] 31 | ;; XXX: when no text returned, tell user no defn/defn- detected? 32 | (when text 33 | ;; row, col values need to be one less for atom api 34 | (let [[[start-row start-col] [end-row end-col]] text-range] 35 | (.setTextInBufferRange (aa/current-editor) 36 | #js [#js [(dec start-row) (dec start-col)] 37 | #js [(dec end-row) (dec end-col)]] 38 | text)))))) 39 | (.on stdout "end" 40 | (fn [] 41 | (println "finished!"))) 42 | (.on p "close" 43 | (fn [code] 44 | (println (str "exit code: " code)))) 45 | (.on p "error" 46 | (fn [err] 47 | (println (str "err: " err)))) 48 | ;; sending to helper 49 | (.end stdin 50 | (aj/to-str "inlinedef" 51 | ;; buffer text, helper counts from 1 for both row and column values 52 | [(aa/current-buffer) (inc (aa/current-row)) (inc (aa/current-col))])))) 53 | 54 | (defn activate 55 | [s] 56 | (ad/reset-disposables!) 57 | ;; 58 | (ad/command-for "inline-def" inline-def)) 59 | 60 | (defn deactivate 61 | [s] 62 | (ad/dispose-disposables!)) 63 | 64 | (defn before 65 | [done] 66 | (deactivate nil) 67 | (done) 68 | (activate nil) 69 | (aa/info-message "Reloaded Adorn")) 70 | -------------------------------------------------------------------------------- /atom/src/adorn/dispose.cljs: -------------------------------------------------------------------------------- 1 | (ns adorn.dispose) 2 | 3 | (def CompositeDisposable 4 | (.-CompositeDisposable (js/require "atom"))) 5 | 6 | (def disposables 7 | (atom (CompositeDisposable.))) 8 | 9 | (defn dispose-disposables! 10 | [] 11 | (.dispose ^js @disposables)) 12 | 13 | (defn reset-disposables! 14 | [] 15 | (reset! disposables (CompositeDisposable.))) 16 | 17 | (defn command-for 18 | [name f] 19 | (let [disp (-> (.-commands js/atom) 20 | (.add "atom-text-editor" 21 | (str "adorn:" name) 22 | f))] 23 | (.add @disposables disp))) 24 | -------------------------------------------------------------------------------- /atom/src/adorn/jsonrpc.cljs: -------------------------------------------------------------------------------- 1 | (ns adorn.jsonrpc) 2 | 3 | (defn to-str 4 | ([meth params] 5 | (to-str meth params 1)) 6 | ([meth params id] 7 | (.stringify js/JSON 8 | (clj->js {"jsonrpc" "2.0" 9 | "method" meth 10 | "params" params 11 | "id" id})))) 12 | 13 | (defn from-str 14 | [jr-str] 15 | (js->clj (.parse js/JSON jr-str))) 16 | -------------------------------------------------------------------------------- /deps.edn: -------------------------------------------------------------------------------- 1 | { 2 | :deps 3 | { 4 | augistints 5 | { 6 | :git/url "https://github.com/sogaiu/augistints.git" 7 | :sha "debd2d647575074b1ea6dd26937f403e4a8036d2" 8 | } 9 | ;; XXX: 1.10.0 may have problems 10 | org.clojure/clojure {:mvn/version "1.9.0"} 11 | org.clojure/data.json {:mvn/version "0.2.6"} 12 | ;; XXX: workaround for deps.edn processing problem? 13 | rewrite-clj 14 | { 15 | :git/url "https://github.com/sogaiu/rewrite-clj.git" 16 | :sha "3bf6023adf43338e3c8437ca78d859dca7d68ec0" 17 | } 18 | } 19 | 20 | :aliases 21 | { 22 | :native-image 23 | { 24 | :main-opts 25 | [ 26 | "-m clj.native-image script" 27 | "--no-fallback" 28 | "-H:Name=adorn" 29 | "-H:+ReportExceptionStackTraces" 30 | "--report-unsupported-elements-at-runtime" 31 | "-J-Dclojure.compiler.direct-linking=true" 32 | "--initialize-at-build-time" 33 | "--verbose" 34 | ] 35 | :extra-deps 36 | { 37 | clj.native-image 38 | { 39 | :git/url "https://github.com/taylorwood/clj.native-image.git" 40 | :sha "f27bf5ed1c03bb25715be47c9365d39cdcee7c41" 41 | } 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /emacs/README.adoc: -------------------------------------------------------------------------------- 1 | = Adorn Emacs Package 2 | 3 | == Prerequisites 4 | 5 | * Adorn command line program built 6 | * Emacs (>= 25.2) 7 | * A sacrificial / backed-up Clojure file 8 | 9 | == Setup 10 | 11 | * Put the directory containing this file somewhere so that the contained adorn.el file ends up on your load-path. 12 | 13 | * In the bin subdirectory, make a copy of the adorn binary, or create a symlink to it. 14 | 15 | * In your equivalent of .emacs, add `(require 'adorn)`. 16 | 17 | Note that it's important for adorn.el and the bin subdirectory (with its content) to end up in the same directory. 18 | 19 | == Starting 20 | 21 | * Start Emacs 22 | 23 | * Open a Clojure file with at least one defn or defn- in it. 24 | 25 | == Invoking 26 | 27 | * Move point to somewhere within a defn or defn- form. 28 | 29 | * M-x adorn-inline-def 30 | 31 | * This should result in an https://blog.michielborkent.nl/2017/05/25/inline-def-debugging/[Inline Def] transformation being applied to the defn. 32 | -------------------------------------------------------------------------------- /emacs/adorn.el: -------------------------------------------------------------------------------- 1 | ;;; adorn.el --- Wrapper for adorn -*- lexical-binding: t; -*- 2 | 3 | ;; Author: sogaiu 4 | ;; URL: https://github.com/sogaiu/adorn/emacs 5 | ;; Version: 0.1-pre 6 | ;; Package-Requires: ((emacs "25.2")) 7 | ;; Keywords: instrumentation 8 | 9 | ;; This file is not part of GNU Emacs. 10 | 11 | ;;; Commentary: 12 | 13 | ;; 14 | 15 | ;;;; Installation 16 | 17 | ;;;;; Manual 18 | 19 | ;; Put this file in your load-path, and put this in your init file: 20 | 21 | ;; (require 'adorn) 22 | 23 | ;;;; Usage 24 | 25 | ;; With point in an appropriate Clojure form, run one of the commands: 26 | 27 | ;; `adorn-inline-def': try to add inline-defs to a Clojure defn / defn- 28 | 29 | ;;;; Issues 30 | 31 | ;; `adorn-inline-def' modifies where point is -- is this appropriate? 32 | 33 | ;; `adorn-temp-output' is stateful -- is it reset appropriately? 34 | 35 | ;; `adorn-path' computes the path to the adorn binary -- what if this fails? 36 | 37 | ;;; Code: 38 | 39 | ;;;; Requirements 40 | 41 | (require 'files) 42 | (require 'json) 43 | (require 'simple) 44 | 45 | ;;;;; Variables 46 | 47 | ;; XXX: should be some kind of local thing? 48 | (defvar adorn-temp-output 49 | '() 50 | "List to accumulate output from adorn process.") 51 | 52 | ;;;;; Commands 53 | 54 | (defun adorn-path () 55 | "Determine path to adorn binary." 56 | (concat (locate-dominating-file 57 | (symbol-file 'adorn-temp-output) 58 | "adorn.el") 59 | "bin/adorn")) 60 | 61 | (defun adorn-filter (process output) 62 | "Filter for processing adorn command output." 63 | (setq adorn-temp-output 64 | (cons output adorn-temp-output))) 65 | 66 | (defun adorn-reset-temp-output () 67 | (setq adorn-temp-output '())) 68 | 69 | ;; based on: 70 | ;; https://emacs.stackexchange.com/a/8083 71 | (defun adorn-pos-at-row-col (row col) 72 | "Determine buffer position for ROW, COL. 73 | 74 | ROW and COL are zero-based, i.e. 0, 0 is the beginning of the buffer." 75 | (save-excursion 76 | (goto-char (point-min)) 77 | (forward-line row) 78 | (move-to-column col) 79 | (point))) 80 | 81 | ;; handles processing complete output from adorn process 82 | (defun adorn-sentinel (process event) 83 | "Sentinel for adorn process." 84 | (when (equal "finished\n" event) 85 | (let* ((output-str (apply 'concat adorn-temp-output)) 86 | (parsed (adorn-from-json-rpc-str output-str)) 87 | (result (cdr (assoc 'result parsed))) 88 | (new-text (elt result 0)) 89 | (range (elt result 1))) 90 | (if (vectorp range) 91 | ;; XXX: want destructuring bind 92 | (let* ((start-pair (elt range 0)) 93 | (start-row (elt start-pair 0)) 94 | (start-col (elt start-pair 1)) 95 | (start (adorn-pos-at-row-col (1- start-row) (1- start-col))) 96 | (end-pair (elt range 1)) 97 | (end-row (elt end-pair 0)) 98 | (end-col (elt end-pair 1)) 99 | (end (adorn-pos-at-row-col (1- end-row) (1- end-col)))) 100 | (delete-region start end) 101 | (insert new-text)) 102 | (message "adorn didn't change anything"))) 103 | (adorn-reset-temp-output))) 104 | 105 | (defun adorn-to-json-rpc-str (method params id) 106 | "Create JSON RPC string from METHOD, PARAMS, and ID." 107 | (json-encode (list (cons "jsonrpc" "2.0") 108 | (cons "method" method) 109 | (cons "params" params) 110 | (cons "id" id)))) 111 | 112 | (defun adorn-from-json-rpc-str (json-rpc-str) 113 | "Parse JSON-RPC-STR." 114 | (json-read-from-string json-rpc-str)) 115 | 116 | (defun adorn-get-buffer-text () 117 | (buffer-substring-no-properties 1 (1+ (buffer-size)))) 118 | 119 | ;;;###autoload 120 | (defun adorn-inline-def () 121 | "Apply the inline-def transformation to a defn surrounding point." 122 | (interactive) 123 | (condition-case err 124 | (let* ((json-rpc-str 125 | (adorn-to-json-rpc-str "inlinedef" 126 | (list (adorn-get-buffer-text) 127 | (line-number-at-pos) 128 | (1+ (current-column))) 129 | 1)) 130 | (adorn-proc (make-process :name "adorn" 131 | :buffer nil 132 | :command (list (adorn-path)) 133 | :connection-type 'pipe 134 | :filter 'adorn-filter 135 | :sentinel 'adorn-sentinel))) 136 | (when adorn-proc 137 | ;; XXX: is this sufficient? 138 | (adorn-reset-temp-output) 139 | (process-send-string adorn-proc json-rpc-str) 140 | (process-send-eof adorn-proc))) 141 | (error 142 | (message "Error: %s %s" (car err) (cdr err))))) 143 | 144 | ;;;; Footer 145 | 146 | (provide 'adorn) 147 | 148 | ;;; adorn.el ends here 149 | 150 | ;; (setq test-str 151 | ;; (adorn-to-json-rpc-str "inlinedef" 152 | ;; '("(defn my-fn [a] (+ a 1))" 1 5) 153 | ;; 1)) 154 | 155 | ;; (setq adorn-proc 156 | ;; (make-process :name "adorn" 157 | ;; :command (list (adorn-path)) 158 | ;; :connection-type 'pipe 159 | ;; :filter 'adorn-filter 160 | ;; :sentinel 'adorn-sentinel)) 161 | 162 | ;; (process-send-string adorn-proc 163 | ;; test-str) 164 | 165 | ;; (process-send-eof adorn-proc) 166 | -------------------------------------------------------------------------------- /emacs/bin/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sogaiu/adorn/2cc6712810c2a6dc7a02c24a5cc5951266e2e786/emacs/bin/.keep -------------------------------------------------------------------------------- /src/script.clj: -------------------------------------------------------------------------------- 1 | (ns script 2 | (:require 3 | [augistints.core :as ac] 4 | [clojure.data.json :as cdj] 5 | [rewrite-clj.zip :as rz]) 6 | (:gen-class)) 7 | 8 | (set! *warn-on-reflection* true) 9 | 10 | (defn find-defn-zloc-at 11 | [forms-str row col] 12 | (let [curr-zloc (-> (rz/of-string forms-str 13 | {:track-position? true}) 14 | (rz/find-last-by-pos [row col])) 15 | initial-char (first (rz/string curr-zloc)) 16 | curr-zloc (if (= initial-char \() 17 | (rz/down curr-zloc) 18 | curr-zloc)] 19 | (loop [curr-zloc curr-zloc] 20 | (when curr-zloc 21 | (let [lm-zloc (rz/leftmost curr-zloc) 22 | up-zloc (rz/up lm-zloc)] 23 | (if (#{'defn 'defn-} (rz/sexpr lm-zloc)) 24 | up-zloc 25 | (recur up-zloc))))))) 26 | 27 | (defn -main [& args] 28 | ;; XXX: expects json rpc string on stdin, e.g. 29 | ;; {"jsonrpc": "2.0", 30 | ;; "method": "inlinedef", 31 | ;; "params": ["(defn my-fn [a] (+ a 1))", 3, 4], 32 | ;; "id": 1} 33 | (let [slurped (slurp *in*) 34 | {:keys [method params id] :as input} 35 | (cdj/read-str slurped :key-fn keyword) 36 | [text row col] params 37 | defn-zloc (find-defn-zloc-at text row col) 38 | [new-text new-range] 39 | (if defn-zloc 40 | (cond 41 | (= method "inlinedef") 42 | [(-> (rz/string defn-zloc) 43 | (ac/prepend-to-defn-body (ac/make-inline-def-with-meta-gen 44 | {:adorn/inlinedef true})) 45 | ac/cljfmt) 46 | (rz/position-span defn-zloc)] 47 | ;; 48 | (= method "tapargs") 49 | [(-> (rz/string defn-zloc) 50 | (ac/prepend-to-defn-body ac/log-defn-args-gen) 51 | ac/cljfmt) 52 | (rz/position-span defn-zloc)] 53 | ;; 54 | :else 55 | [nil nil]) 56 | [nil nil])] 57 | ;; XXX: check for errors? 58 | (-> (assoc {"jsonrpc" "2.0", "id" id} 59 | "result" [new-text new-range]) 60 | cdj/write-str 61 | println) 62 | (flush) 63 | (System/exit 0))) 64 | 65 | (comment 66 | 67 | ;; try feeding the following via stdin 68 | 69 | ;;{"jsonrpc": "2.0", "method": "inlinedef", "params": ["(defn my-fn [a] (+ a 1))", 1, 1], "id": 1} 70 | 71 | ;;{"jsonrpc": "2.0", "method": "tapargs", "params": ["(defn my-fn [a] (+ a 1))", 1, 1], "id": 1} 72 | ) 73 | -------------------------------------------------------------------------------- /vscode/.gitignore: -------------------------------------------------------------------------------- 1 | out/ 2 | node_modules/ 3 | 4 | .shadow-cljs 5 | -------------------------------------------------------------------------------- /vscode/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Run Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "runtimeExecutable": "${execPath}", 9 | "args": ["--extensionDevelopmentPath=${workspaceFolder}"] 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /vscode/README.adoc: -------------------------------------------------------------------------------- 1 | = Adorn VSCode Extension 2 | 3 | == Prerequisites 4 | 5 | * Adorn command line program built 6 | * VSCode 7 | * npm 8 | * A sacrificial / backed-up Clojure project directory 9 | 10 | == Building 11 | 12 | * In some terminal: 13 | 14 | ---- 15 | # install dependencies 16 | npm install 17 | # build + watch for changes 18 | npx shadow-cljs watch dev 19 | ---- 20 | 21 | If all went well, there should now be a fresh file at lib/main.js (the "compiled" extension). 22 | 23 | * In the bin subdirectory, make a copy of the adorn binary, or create a symlink to it. 24 | 25 | == Starting 26 | 27 | * Start VSCode 28 | 29 | * Open the folder containing this file in VSCode. 30 | 31 | * From the menu bar, choose Debug -> Start Debugging (or press F5). This should result in another VSCode window opening. 32 | 33 | * In the new VSCode window, open a folder that has at least one Clojure file in it. 34 | 35 | == Invoking 36 | 37 | * Open a Clojure file in an editor pane and move the cursor to somewhere within a defn form. 38 | 39 | * Bring up the https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette[command palette], look for / start typing "Inline Def", and once found / selected, press Enter / Return. 40 | 41 | * This should result in an https://blog.michielborkent.nl/2017/05/25/inline-def-debugging/[Inline Def] transformation being applied to the defn. 42 | 43 | == Notes 44 | 45 | * Using more than one shadow-cljs-based VSCode extension that is not compiled for release is likely to lead to problems. To build for release: 46 | 47 | ---- 48 | npx shadow-cljs release dev 49 | ---- 50 | 51 | * Another command provided is "Tap Arguments". This should modify a defn form so that its arguments are logged via tap>. 52 | -------------------------------------------------------------------------------- /vscode/bin/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sogaiu/adorn/2cc6712810c2a6dc7a02c24a5cc5951266e2e786/vscode/bin/.keep -------------------------------------------------------------------------------- /vscode/lib/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sogaiu/adorn/2cc6712810c2a6dc7a02c24a5cc5951266e2e786/vscode/lib/.keep -------------------------------------------------------------------------------- /vscode/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-adorn", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "asn1.js": { 8 | "version": "5.4.1", 9 | "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", 10 | "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", 11 | "dev": true, 12 | "requires": { 13 | "bn.js": "^4.0.0", 14 | "inherits": "^2.0.1", 15 | "minimalistic-assert": "^1.0.0", 16 | "safer-buffer": "^2.1.0" 17 | }, 18 | "dependencies": { 19 | "bn.js": { 20 | "version": "4.12.0", 21 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", 22 | "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", 23 | "dev": true 24 | } 25 | } 26 | }, 27 | "assert": { 28 | "version": "1.5.0", 29 | "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", 30 | "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", 31 | "dev": true, 32 | "requires": { 33 | "object-assign": "^4.1.1", 34 | "util": "0.10.3" 35 | }, 36 | "dependencies": { 37 | "util": { 38 | "version": "0.10.3", 39 | "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", 40 | "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", 41 | "dev": true, 42 | "requires": { 43 | "inherits": "2.0.1" 44 | } 45 | } 46 | } 47 | }, 48 | "async-limiter": { 49 | "version": "1.0.1", 50 | "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", 51 | "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", 52 | "dev": true 53 | }, 54 | "base64-js": { 55 | "version": "1.5.1", 56 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 57 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 58 | "dev": true 59 | }, 60 | "bn.js": { 61 | "version": "5.2.0", 62 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", 63 | "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", 64 | "dev": true 65 | }, 66 | "brorand": { 67 | "version": "1.1.0", 68 | "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", 69 | "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", 70 | "dev": true 71 | }, 72 | "browserify-aes": { 73 | "version": "1.2.0", 74 | "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", 75 | "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", 76 | "dev": true, 77 | "requires": { 78 | "buffer-xor": "^1.0.3", 79 | "cipher-base": "^1.0.0", 80 | "create-hash": "^1.1.0", 81 | "evp_bytestokey": "^1.0.3", 82 | "inherits": "^2.0.1", 83 | "safe-buffer": "^5.0.1" 84 | } 85 | }, 86 | "browserify-cipher": { 87 | "version": "1.0.1", 88 | "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", 89 | "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", 90 | "dev": true, 91 | "requires": { 92 | "browserify-aes": "^1.0.4", 93 | "browserify-des": "^1.0.0", 94 | "evp_bytestokey": "^1.0.0" 95 | } 96 | }, 97 | "browserify-des": { 98 | "version": "1.0.2", 99 | "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", 100 | "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", 101 | "dev": true, 102 | "requires": { 103 | "cipher-base": "^1.0.1", 104 | "des.js": "^1.0.0", 105 | "inherits": "^2.0.1", 106 | "safe-buffer": "^5.1.2" 107 | } 108 | }, 109 | "browserify-rsa": { 110 | "version": "4.1.0", 111 | "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", 112 | "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", 113 | "dev": true, 114 | "requires": { 115 | "bn.js": "^5.0.0", 116 | "randombytes": "^2.0.1" 117 | } 118 | }, 119 | "browserify-sign": { 120 | "version": "4.2.1", 121 | "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", 122 | "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", 123 | "dev": true, 124 | "requires": { 125 | "bn.js": "^5.1.1", 126 | "browserify-rsa": "^4.0.1", 127 | "create-hash": "^1.2.0", 128 | "create-hmac": "^1.1.7", 129 | "elliptic": "^6.5.3", 130 | "inherits": "^2.0.4", 131 | "parse-asn1": "^5.1.5", 132 | "readable-stream": "^3.6.0", 133 | "safe-buffer": "^5.2.0" 134 | }, 135 | "dependencies": { 136 | "inherits": { 137 | "version": "2.0.4", 138 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 139 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 140 | "dev": true 141 | }, 142 | "readable-stream": { 143 | "version": "3.6.0", 144 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", 145 | "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", 146 | "dev": true, 147 | "requires": { 148 | "inherits": "^2.0.3", 149 | "string_decoder": "^1.1.1", 150 | "util-deprecate": "^1.0.1" 151 | } 152 | } 153 | } 154 | }, 155 | "browserify-zlib": { 156 | "version": "0.2.0", 157 | "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", 158 | "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", 159 | "dev": true, 160 | "requires": { 161 | "pako": "~1.0.5" 162 | } 163 | }, 164 | "buffer": { 165 | "version": "4.9.2", 166 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", 167 | "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", 168 | "dev": true, 169 | "requires": { 170 | "base64-js": "^1.0.2", 171 | "ieee754": "^1.1.4", 172 | "isarray": "^1.0.0" 173 | } 174 | }, 175 | "buffer-from": { 176 | "version": "1.1.1", 177 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", 178 | "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", 179 | "dev": true 180 | }, 181 | "buffer-xor": { 182 | "version": "1.0.3", 183 | "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", 184 | "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", 185 | "dev": true 186 | }, 187 | "builtin-status-codes": { 188 | "version": "3.0.0", 189 | "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", 190 | "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", 191 | "dev": true 192 | }, 193 | "cipher-base": { 194 | "version": "1.0.4", 195 | "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", 196 | "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", 197 | "dev": true, 198 | "requires": { 199 | "inherits": "^2.0.1", 200 | "safe-buffer": "^5.0.1" 201 | } 202 | }, 203 | "console-browserify": { 204 | "version": "1.2.0", 205 | "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", 206 | "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", 207 | "dev": true 208 | }, 209 | "constants-browserify": { 210 | "version": "1.0.0", 211 | "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", 212 | "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", 213 | "dev": true 214 | }, 215 | "core-util-is": { 216 | "version": "1.0.2", 217 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 218 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", 219 | "dev": true 220 | }, 221 | "create-ecdh": { 222 | "version": "4.0.4", 223 | "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", 224 | "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", 225 | "dev": true, 226 | "requires": { 227 | "bn.js": "^4.1.0", 228 | "elliptic": "^6.5.3" 229 | }, 230 | "dependencies": { 231 | "bn.js": { 232 | "version": "4.12.0", 233 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", 234 | "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", 235 | "dev": true 236 | } 237 | } 238 | }, 239 | "create-hash": { 240 | "version": "1.2.0", 241 | "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", 242 | "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", 243 | "dev": true, 244 | "requires": { 245 | "cipher-base": "^1.0.1", 246 | "inherits": "^2.0.1", 247 | "md5.js": "^1.3.4", 248 | "ripemd160": "^2.0.1", 249 | "sha.js": "^2.4.0" 250 | } 251 | }, 252 | "create-hmac": { 253 | "version": "1.1.7", 254 | "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", 255 | "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", 256 | "dev": true, 257 | "requires": { 258 | "cipher-base": "^1.0.3", 259 | "create-hash": "^1.1.0", 260 | "inherits": "^2.0.1", 261 | "ripemd160": "^2.0.0", 262 | "safe-buffer": "^5.0.1", 263 | "sha.js": "^2.4.8" 264 | } 265 | }, 266 | "crypto-browserify": { 267 | "version": "3.12.0", 268 | "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", 269 | "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", 270 | "dev": true, 271 | "requires": { 272 | "browserify-cipher": "^1.0.0", 273 | "browserify-sign": "^4.0.0", 274 | "create-ecdh": "^4.0.0", 275 | "create-hash": "^1.1.0", 276 | "create-hmac": "^1.1.0", 277 | "diffie-hellman": "^5.0.0", 278 | "inherits": "^2.0.1", 279 | "pbkdf2": "^3.0.3", 280 | "public-encrypt": "^4.0.0", 281 | "randombytes": "^2.0.0", 282 | "randomfill": "^1.0.3" 283 | } 284 | }, 285 | "des.js": { 286 | "version": "1.0.1", 287 | "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", 288 | "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", 289 | "dev": true, 290 | "requires": { 291 | "inherits": "^2.0.1", 292 | "minimalistic-assert": "^1.0.0" 293 | } 294 | }, 295 | "diffie-hellman": { 296 | "version": "5.0.3", 297 | "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", 298 | "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", 299 | "dev": true, 300 | "requires": { 301 | "bn.js": "^4.1.0", 302 | "miller-rabin": "^4.0.0", 303 | "randombytes": "^2.0.0" 304 | }, 305 | "dependencies": { 306 | "bn.js": { 307 | "version": "4.12.0", 308 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", 309 | "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", 310 | "dev": true 311 | } 312 | } 313 | }, 314 | "domain-browser": { 315 | "version": "1.2.0", 316 | "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", 317 | "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", 318 | "dev": true 319 | }, 320 | "elliptic": { 321 | "version": "6.5.4", 322 | "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", 323 | "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", 324 | "dev": true, 325 | "requires": { 326 | "bn.js": "^4.11.9", 327 | "brorand": "^1.1.0", 328 | "hash.js": "^1.0.0", 329 | "hmac-drbg": "^1.0.1", 330 | "inherits": "^2.0.4", 331 | "minimalistic-assert": "^1.0.1", 332 | "minimalistic-crypto-utils": "^1.0.1" 333 | }, 334 | "dependencies": { 335 | "bn.js": { 336 | "version": "4.12.0", 337 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", 338 | "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", 339 | "dev": true 340 | }, 341 | "inherits": { 342 | "version": "2.0.4", 343 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 344 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 345 | "dev": true 346 | } 347 | } 348 | }, 349 | "events": { 350 | "version": "3.3.0", 351 | "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", 352 | "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", 353 | "dev": true 354 | }, 355 | "evp_bytestokey": { 356 | "version": "1.0.3", 357 | "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", 358 | "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", 359 | "dev": true, 360 | "requires": { 361 | "md5.js": "^1.3.4", 362 | "safe-buffer": "^5.1.1" 363 | } 364 | }, 365 | "hash-base": { 366 | "version": "3.1.0", 367 | "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", 368 | "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", 369 | "dev": true, 370 | "requires": { 371 | "inherits": "^2.0.4", 372 | "readable-stream": "^3.6.0", 373 | "safe-buffer": "^5.2.0" 374 | }, 375 | "dependencies": { 376 | "inherits": { 377 | "version": "2.0.4", 378 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 379 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 380 | "dev": true 381 | }, 382 | "readable-stream": { 383 | "version": "3.6.0", 384 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", 385 | "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", 386 | "dev": true, 387 | "requires": { 388 | "inherits": "^2.0.3", 389 | "string_decoder": "^1.1.1", 390 | "util-deprecate": "^1.0.1" 391 | } 392 | } 393 | } 394 | }, 395 | "hash.js": { 396 | "version": "1.1.7", 397 | "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", 398 | "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", 399 | "dev": true, 400 | "requires": { 401 | "inherits": "^2.0.3", 402 | "minimalistic-assert": "^1.0.1" 403 | }, 404 | "dependencies": { 405 | "inherits": { 406 | "version": "2.0.4", 407 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 408 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 409 | "dev": true 410 | } 411 | } 412 | }, 413 | "hmac-drbg": { 414 | "version": "1.0.1", 415 | "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", 416 | "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", 417 | "dev": true, 418 | "requires": { 419 | "hash.js": "^1.0.3", 420 | "minimalistic-assert": "^1.0.0", 421 | "minimalistic-crypto-utils": "^1.0.1" 422 | } 423 | }, 424 | "https-browserify": { 425 | "version": "1.0.0", 426 | "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", 427 | "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", 428 | "dev": true 429 | }, 430 | "ieee754": { 431 | "version": "1.2.1", 432 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", 433 | "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", 434 | "dev": true 435 | }, 436 | "inherits": { 437 | "version": "2.0.1", 438 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", 439 | "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", 440 | "dev": true 441 | }, 442 | "isarray": { 443 | "version": "1.0.0", 444 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 445 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", 446 | "dev": true 447 | }, 448 | "isexe": { 449 | "version": "2.0.0", 450 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 451 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 452 | "dev": true 453 | }, 454 | "md5.js": { 455 | "version": "1.3.5", 456 | "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", 457 | "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", 458 | "dev": true, 459 | "requires": { 460 | "hash-base": "^3.0.0", 461 | "inherits": "^2.0.1", 462 | "safe-buffer": "^5.1.2" 463 | } 464 | }, 465 | "miller-rabin": { 466 | "version": "4.0.1", 467 | "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", 468 | "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", 469 | "dev": true, 470 | "requires": { 471 | "bn.js": "^4.0.0", 472 | "brorand": "^1.0.1" 473 | }, 474 | "dependencies": { 475 | "bn.js": { 476 | "version": "4.12.0", 477 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", 478 | "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", 479 | "dev": true 480 | } 481 | } 482 | }, 483 | "minimalistic-assert": { 484 | "version": "1.0.1", 485 | "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", 486 | "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", 487 | "dev": true 488 | }, 489 | "minimalistic-crypto-utils": { 490 | "version": "1.0.1", 491 | "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", 492 | "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", 493 | "dev": true 494 | }, 495 | "node-libs-browser": { 496 | "version": "2.2.1", 497 | "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", 498 | "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", 499 | "dev": true, 500 | "requires": { 501 | "assert": "^1.1.1", 502 | "browserify-zlib": "^0.2.0", 503 | "buffer": "^4.3.0", 504 | "console-browserify": "^1.1.0", 505 | "constants-browserify": "^1.0.0", 506 | "crypto-browserify": "^3.11.0", 507 | "domain-browser": "^1.1.1", 508 | "events": "^3.0.0", 509 | "https-browserify": "^1.0.0", 510 | "os-browserify": "^0.3.0", 511 | "path-browserify": "0.0.1", 512 | "process": "^0.11.10", 513 | "punycode": "^1.2.4", 514 | "querystring-es3": "^0.2.0", 515 | "readable-stream": "^2.3.3", 516 | "stream-browserify": "^2.0.1", 517 | "stream-http": "^2.7.2", 518 | "string_decoder": "^1.0.0", 519 | "timers-browserify": "^2.0.4", 520 | "tty-browserify": "0.0.0", 521 | "url": "^0.11.0", 522 | "util": "^0.11.0", 523 | "vm-browserify": "^1.0.1" 524 | } 525 | }, 526 | "object-assign": { 527 | "version": "4.1.1", 528 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 529 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 530 | "dev": true 531 | }, 532 | "os-browserify": { 533 | "version": "0.3.0", 534 | "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", 535 | "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", 536 | "dev": true 537 | }, 538 | "pako": { 539 | "version": "1.0.11", 540 | "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", 541 | "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", 542 | "dev": true 543 | }, 544 | "parse-asn1": { 545 | "version": "5.1.6", 546 | "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", 547 | "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", 548 | "dev": true, 549 | "requires": { 550 | "asn1.js": "^5.2.0", 551 | "browserify-aes": "^1.0.0", 552 | "evp_bytestokey": "^1.0.0", 553 | "pbkdf2": "^3.0.3", 554 | "safe-buffer": "^5.1.1" 555 | } 556 | }, 557 | "path-browserify": { 558 | "version": "0.0.1", 559 | "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", 560 | "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", 561 | "dev": true 562 | }, 563 | "pbkdf2": { 564 | "version": "3.1.1", 565 | "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", 566 | "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", 567 | "dev": true, 568 | "requires": { 569 | "create-hash": "^1.1.2", 570 | "create-hmac": "^1.1.4", 571 | "ripemd160": "^2.0.1", 572 | "safe-buffer": "^5.0.1", 573 | "sha.js": "^2.4.8" 574 | } 575 | }, 576 | "process": { 577 | "version": "0.11.10", 578 | "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", 579 | "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", 580 | "dev": true 581 | }, 582 | "process-nextick-args": { 583 | "version": "2.0.1", 584 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 585 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", 586 | "dev": true 587 | }, 588 | "public-encrypt": { 589 | "version": "4.0.3", 590 | "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", 591 | "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", 592 | "dev": true, 593 | "requires": { 594 | "bn.js": "^4.1.0", 595 | "browserify-rsa": "^4.0.0", 596 | "create-hash": "^1.1.0", 597 | "parse-asn1": "^5.0.0", 598 | "randombytes": "^2.0.1", 599 | "safe-buffer": "^5.1.2" 600 | }, 601 | "dependencies": { 602 | "bn.js": { 603 | "version": "4.12.0", 604 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", 605 | "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", 606 | "dev": true 607 | } 608 | } 609 | }, 610 | "punycode": { 611 | "version": "1.4.1", 612 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 613 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", 614 | "dev": true 615 | }, 616 | "querystring": { 617 | "version": "0.2.0", 618 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", 619 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", 620 | "dev": true 621 | }, 622 | "querystring-es3": { 623 | "version": "0.2.1", 624 | "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", 625 | "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", 626 | "dev": true 627 | }, 628 | "randombytes": { 629 | "version": "2.1.0", 630 | "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", 631 | "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", 632 | "dev": true, 633 | "requires": { 634 | "safe-buffer": "^5.1.0" 635 | } 636 | }, 637 | "randomfill": { 638 | "version": "1.0.4", 639 | "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", 640 | "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", 641 | "dev": true, 642 | "requires": { 643 | "randombytes": "^2.0.5", 644 | "safe-buffer": "^5.1.0" 645 | } 646 | }, 647 | "readable-stream": { 648 | "version": "2.3.7", 649 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 650 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 651 | "dev": true, 652 | "requires": { 653 | "core-util-is": "~1.0.0", 654 | "inherits": "~2.0.3", 655 | "isarray": "~1.0.0", 656 | "process-nextick-args": "~2.0.0", 657 | "safe-buffer": "~5.1.1", 658 | "string_decoder": "~1.1.1", 659 | "util-deprecate": "~1.0.1" 660 | }, 661 | "dependencies": { 662 | "inherits": { 663 | "version": "2.0.4", 664 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 665 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 666 | "dev": true 667 | }, 668 | "safe-buffer": { 669 | "version": "5.1.2", 670 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 671 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 672 | "dev": true 673 | }, 674 | "string_decoder": { 675 | "version": "1.1.1", 676 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 677 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 678 | "dev": true, 679 | "requires": { 680 | "safe-buffer": "~5.1.0" 681 | } 682 | } 683 | } 684 | }, 685 | "readline-sync": { 686 | "version": "1.4.10", 687 | "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", 688 | "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", 689 | "dev": true 690 | }, 691 | "ripemd160": { 692 | "version": "2.0.2", 693 | "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", 694 | "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", 695 | "dev": true, 696 | "requires": { 697 | "hash-base": "^3.0.0", 698 | "inherits": "^2.0.1" 699 | } 700 | }, 701 | "safe-buffer": { 702 | "version": "5.2.1", 703 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 704 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 705 | "dev": true 706 | }, 707 | "safer-buffer": { 708 | "version": "2.1.2", 709 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 710 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 711 | "dev": true 712 | }, 713 | "setimmediate": { 714 | "version": "1.0.5", 715 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", 716 | "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", 717 | "dev": true 718 | }, 719 | "sha.js": { 720 | "version": "2.4.11", 721 | "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", 722 | "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", 723 | "dev": true, 724 | "requires": { 725 | "inherits": "^2.0.1", 726 | "safe-buffer": "^5.0.1" 727 | } 728 | }, 729 | "shadow-cljs": { 730 | "version": "2.11.23", 731 | "resolved": "https://registry.npmjs.org/shadow-cljs/-/shadow-cljs-2.11.23.tgz", 732 | "integrity": "sha512-jVTvvKSKubapqQjZs7nuhJch+71usUKErlqV+03VfCLIslmp8rwCLZK3EjrjI5kr8YJALhXG4lCdPJBuorwuKg==", 733 | "dev": true, 734 | "requires": { 735 | "node-libs-browser": "^2.2.1", 736 | "readline-sync": "^1.4.7", 737 | "shadow-cljs-jar": "1.3.2", 738 | "source-map-support": "^0.4.15", 739 | "which": "^1.3.1", 740 | "ws": "^3.0.0" 741 | }, 742 | "dependencies": { 743 | "source-map-support": { 744 | "version": "0.4.18", 745 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", 746 | "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", 747 | "dev": true, 748 | "requires": { 749 | "source-map": "^0.5.6" 750 | } 751 | } 752 | } 753 | }, 754 | "shadow-cljs-jar": { 755 | "version": "1.3.2", 756 | "resolved": "https://registry.npmjs.org/shadow-cljs-jar/-/shadow-cljs-jar-1.3.2.tgz", 757 | "integrity": "sha512-XmeffAZHv8z7451kzeq9oKh8fh278Ak+UIOGGrapyqrFBB773xN8vMQ3O7J7TYLnb9BUwcqadKkmgaq7q6fhZg==", 758 | "dev": true 759 | }, 760 | "source-map": { 761 | "version": "0.5.7", 762 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", 763 | "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", 764 | "dev": true 765 | }, 766 | "source-map-support": { 767 | "version": "0.5.19", 768 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", 769 | "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", 770 | "dev": true, 771 | "requires": { 772 | "buffer-from": "^1.0.0", 773 | "source-map": "^0.6.0" 774 | }, 775 | "dependencies": { 776 | "source-map": { 777 | "version": "0.6.1", 778 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 779 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 780 | "dev": true 781 | } 782 | } 783 | }, 784 | "stream-browserify": { 785 | "version": "2.0.2", 786 | "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", 787 | "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", 788 | "dev": true, 789 | "requires": { 790 | "inherits": "~2.0.1", 791 | "readable-stream": "^2.0.2" 792 | } 793 | }, 794 | "stream-http": { 795 | "version": "2.8.3", 796 | "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", 797 | "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", 798 | "dev": true, 799 | "requires": { 800 | "builtin-status-codes": "^3.0.0", 801 | "inherits": "^2.0.1", 802 | "readable-stream": "^2.3.6", 803 | "to-arraybuffer": "^1.0.0", 804 | "xtend": "^4.0.0" 805 | } 806 | }, 807 | "string_decoder": { 808 | "version": "1.3.0", 809 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", 810 | "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", 811 | "dev": true, 812 | "requires": { 813 | "safe-buffer": "~5.2.0" 814 | } 815 | }, 816 | "timers-browserify": { 817 | "version": "2.0.12", 818 | "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", 819 | "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", 820 | "dev": true, 821 | "requires": { 822 | "setimmediate": "^1.0.4" 823 | } 824 | }, 825 | "to-arraybuffer": { 826 | "version": "1.0.1", 827 | "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", 828 | "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", 829 | "dev": true 830 | }, 831 | "tty-browserify": { 832 | "version": "0.0.0", 833 | "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", 834 | "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", 835 | "dev": true 836 | }, 837 | "ultron": { 838 | "version": "1.1.1", 839 | "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", 840 | "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", 841 | "dev": true 842 | }, 843 | "url": { 844 | "version": "0.11.0", 845 | "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", 846 | "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", 847 | "dev": true, 848 | "requires": { 849 | "punycode": "1.3.2", 850 | "querystring": "0.2.0" 851 | }, 852 | "dependencies": { 853 | "punycode": { 854 | "version": "1.3.2", 855 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", 856 | "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", 857 | "dev": true 858 | } 859 | } 860 | }, 861 | "util": { 862 | "version": "0.11.1", 863 | "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", 864 | "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", 865 | "dev": true, 866 | "requires": { 867 | "inherits": "2.0.3" 868 | }, 869 | "dependencies": { 870 | "inherits": { 871 | "version": "2.0.3", 872 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 873 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 874 | "dev": true 875 | } 876 | } 877 | }, 878 | "util-deprecate": { 879 | "version": "1.0.2", 880 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 881 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", 882 | "dev": true 883 | }, 884 | "vm-browserify": { 885 | "version": "1.1.2", 886 | "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", 887 | "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", 888 | "dev": true 889 | }, 890 | "which": { 891 | "version": "1.3.1", 892 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 893 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 894 | "dev": true, 895 | "requires": { 896 | "isexe": "^2.0.0" 897 | } 898 | }, 899 | "ws": { 900 | "version": "3.3.3", 901 | "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", 902 | "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", 903 | "dev": true, 904 | "requires": { 905 | "async-limiter": "~1.0.0", 906 | "safe-buffer": "~5.1.0", 907 | "ultron": "~1.1.0" 908 | }, 909 | "dependencies": { 910 | "safe-buffer": { 911 | "version": "5.1.2", 912 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 913 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 914 | "dev": true 915 | } 916 | } 917 | }, 918 | "xtend": { 919 | "version": "4.0.2", 920 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", 921 | "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", 922 | "dev": true 923 | } 924 | } 925 | } 926 | -------------------------------------------------------------------------------- /vscode/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-adorn", 3 | "displayName": "vscode-adorn", 4 | "description": "", 5 | "version": "0.0.1", 6 | "publisher": "sogaiu", 7 | "license": "", 8 | "engines": { 9 | "vscode": "^1.34.0" 10 | }, 11 | "categories": [ 12 | "Clojure" 13 | ], 14 | "activationEvents": [ 15 | "onLanguage:clojure", 16 | "onCommand:adorn.inlinedef", 17 | "onCommand:adorn.tapargs" 18 | ], 19 | "main": "./lib/main", 20 | "contributes": { 21 | "commands": [ 22 | { 23 | "command": "adorn.inlinedef", 24 | "title": "Inline Def" 25 | }, 26 | { 27 | "command": "adorn.tapargs", 28 | "title": "Tap Arguments" 29 | } 30 | ] 31 | }, 32 | "scripts": { 33 | "clean": "rm -rf .shadow-cljs/", 34 | "compile": "npx shadow-cljs compile :dev", 35 | "release": "npx shadow-cljs release :dev", 36 | "vsix": "npx shadow-cljs release :dev && rm -rf .shadow-cljs && npx vsce package", 37 | "watch": "npx shadow-cljs watch :dev" 38 | }, 39 | "devDependencies": { 40 | "shadow-cljs": "^2.8.93", 41 | "source-map-support": "^0.5.9" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vscode/shadow-cljs.edn: -------------------------------------------------------------------------------- 1 | ;; shadow-cljs configuration 2 | {:source-paths [ 3 | "lib" 4 | "src" 5 | ] 6 | ;; 7 | :dependencies [] 8 | ;; 9 | :builds 10 | {:dev {:target :node-library 11 | ;; 12 | :compiler-options {:infer-externs :auto} 13 | :exports { 14 | :activate adorn.core/activate 15 | :deactivate adorn.core/deactivate 16 | } 17 | ;; 18 | :output-dir "lib/js" 19 | :output-to "lib/main.js" 20 | :devtools {:before-load-async adorn.core/before}}}} 21 | -------------------------------------------------------------------------------- /vscode/src/adorn/core.cljs: -------------------------------------------------------------------------------- 1 | (ns adorn.core 2 | (:require 3 | [adorn.jsonrpc :as aj] 4 | [adorn.vscode :as av] 5 | ["child_process" :as ncp])) 6 | 7 | (defn adorn-path 8 | [] 9 | ;; XXX: modify if publisher / name changes in package.json 10 | (str (av/extension-path "sogaiu.vscode-adorn") 11 | "/bin/adorn")) 12 | 13 | (defn adorn-defn 14 | [^js editor fn-name] 15 | (av/info-message "invoking helper...") 16 | (let [p (.spawn ncp (adorn-path) #js [] #js {}) 17 | stdout (.-stdout p) 18 | stdin (.-stdin p)] 19 | ;; receiving response from helper 20 | (.on stdout "data" 21 | (fn [data] 22 | ;; XXX: handle error case 23 | (let [[text text-range] 24 | (get (aj/from-str data) 25 | "result")] 26 | ;; XXX: when no text returned, tell user no defn/defn- detected? 27 | (when text 28 | ;; row, col values need to be one less for vscode api 29 | (let [[[start-row start-col] [end-row end-col]] text-range] 30 | (.edit (av/current-editor) 31 | (fn [eb] 32 | (.replace eb 33 | (av/range (dec start-row) (dec start-col) 34 | (dec end-row) (dec end-col)) 35 | text)))))))) 36 | (.on stdout "end" 37 | (fn [] 38 | (println "finished!"))) 39 | (.on p "close" 40 | (fn [code] 41 | (println (str "exit code: " code)))) 42 | (.on p "error" 43 | (fn [err] 44 | (println (str "err: " err)))) 45 | ;; sending to helper 46 | (.end stdin 47 | (aj/to-str fn-name 48 | ;; buffer text, helper counts from 1 for both row and column values 49 | [(av/current-buffer) (inc (av/current-row)) (inc (av/current-col))])))) 50 | 51 | (defn inlinedef 52 | [^js editor] 53 | (adorn-defn editor "inlinedef")) 54 | 55 | (defn tapargs 56 | [^js editor] 57 | (adorn-defn editor "tapargs")) 58 | 59 | (defn activate 60 | [context] 61 | (.log js/console "activate called") 62 | (let [disp-1 (av/register-text-editor-command! 63 | "adorn.inlinedef" 64 | #'inlinedef) 65 | _ (av/push-subscription! context disp-1) 66 | disp-2 (av/register-text-editor-command! 67 | "adorn.tapargs" 68 | #'tapargs) 69 | _ (av/push-subscription! context disp-2)] 70 | true)) 71 | 72 | (defn deactivate 73 | []) 74 | -------------------------------------------------------------------------------- /vscode/src/adorn/jsonrpc.cljs: -------------------------------------------------------------------------------- 1 | (ns adorn.jsonrpc) 2 | 3 | (defn to-str 4 | ([meth params] 5 | (to-str meth params 1)) 6 | ([meth params id] 7 | (.stringify js/JSON 8 | (clj->js {"jsonrpc" "2.0" 9 | "method" meth 10 | "params" params 11 | "id" id})))) 12 | 13 | (defn from-str 14 | [jr-str] 15 | (js->clj (.parse js/JSON jr-str))) 16 | -------------------------------------------------------------------------------- /vscode/src/adorn/vscode.cljs: -------------------------------------------------------------------------------- 1 | (ns adorn.vscode 2 | (:refer-clojure :exclude [range]) 3 | (:require 4 | [clojure.string :as cs] 5 | ["os" :as no] 6 | ["vscode" :as nv])) 7 | 8 | (defn current-platform 9 | [] 10 | (let [os-type (.type no)] 11 | (case os-type 12 | "Darwin" :darwin 13 | "Linux" :linux 14 | "Windows_NT" :win32))) 15 | 16 | ;; id is publisher.name where publisher and name come 17 | ;; from package.json -- however, if publisher is the 18 | ;; empty string, currently undefined_publisher is used :( 19 | (defn extension-path 20 | [id] 21 | (->> id 22 | (.getExtension (.-extensions nv)) 23 | .-extensionPath)) 24 | 25 | (defn register-command! 26 | [id f] 27 | (-> (.-commands nv) 28 | (.registerCommand id f))) 29 | 30 | (defn register-text-editor-command! 31 | [id f] 32 | (-> (.-commands nv) 33 | (.registerTextEditorCommand id f))) 34 | 35 | (defn push-subscription! 36 | [^js ctx disp] 37 | (-> (.-subscriptions ctx) 38 | (.push disp))) 39 | 40 | (defn info-message 41 | [msg] 42 | (-> (.-window nv) 43 | (.showInformationMessage msg))) 44 | 45 | (defn warning-message 46 | [msg] 47 | (-> (.-window nv) 48 | (.showWarningMessage msg))) 49 | 50 | (defn get-config 51 | ([path] 52 | (-> (.-workspace nv) 53 | (.getConfiguration path))) 54 | ([conf key] 55 | (.get conf key))) 56 | 57 | (defn create-terminal 58 | [name] 59 | (-> (.-window nv) 60 | (.createTerminal name))) 61 | 62 | (defn on-did-open-terminal 63 | [cb] 64 | (-> (.-window nv) 65 | (.onDidOpenTerminal cb))) 66 | 67 | (defn new-output-channel 68 | [name] 69 | (-> (.-window nv) 70 | (.createOutputChannel name))) 71 | 72 | (defn current-editor 73 | [] 74 | (-> (.-window nv) 75 | .-activeTextEditor)) 76 | 77 | ;; (defn current-document 78 | ;; ([] 79 | ;; (current-document (current-editor))) 80 | ;; ([^js editor] 81 | ;; (.-document editor))) 82 | 83 | (defn current-line 84 | ([] 85 | (current-line (current-editor))) 86 | ([^js editor] 87 | (-> (.-document editor) 88 | (.lineAt (-> editor 89 | .-selection 90 | .-start)) 91 | (.-text)))) 92 | 93 | (defn current-selection 94 | ([] 95 | (current-selection (current-editor))) 96 | ([^js editor] 97 | (-> (.-document editor) 98 | (.getText (.-selection editor))))) 99 | 100 | (defn current-position 101 | ([] 102 | (current-position (current-editor))) 103 | ([^js editor] 104 | (-> (.-selection editor) 105 | .-active))) 106 | 107 | (defn current-row 108 | ([] 109 | (current-row (current-editor))) 110 | ([^js editor] 111 | (.-line (current-position editor)))) 112 | 113 | (defn current-col 114 | ([] 115 | (current-col (current-editor))) 116 | ([^js editor] 117 | (.-character (current-position editor)))) 118 | 119 | ;; XXX: naming... 120 | (defn current-buffer 121 | ([] 122 | (current-buffer (current-editor))) 123 | ([^js editor] 124 | (-> (.-document editor) 125 | .getText))) 126 | 127 | (defn current-path 128 | ([] 129 | (current-path (current-editor))) 130 | ([^js editor] 131 | (-> (.-document editor) 132 | .-fileName))) 133 | 134 | (defn position 135 | [r c] 136 | (nv/Position. r c)) 137 | 138 | (defn range 139 | ([p1 p2] 140 | (nv/Range. p1 p2)) 141 | ([r1 c1 r2 c2] 142 | (nv/Range. 143 | (position r1 c1) 144 | (position r2 c2)))) 145 | --------------------------------------------------------------------------------