Releases: bobbicodes/lang-clojure-eval
Enable all requires
Well I had a feeling that bringing in rewrite-clj would be worth it...
We have to parse each evaluation to see if it contains a namespace with a :require
and if so, inject them along with the Java interop namespaces. The trick was to keep track of the last namespace declaration evaluated and not replace it when evaluating a region that does not contain one.
Enable Java interop in any namespace
Fixed an issue where interop functions would become unavailable if the user switches namespaces. Adds a dependency for rewrite-clj
(and ~100KB to the unzipped package) which I'm not sure was a good idea because I probably could have just used a regex. It also duplicates functionality of the Lezer parser, which I probably also could have used.
Also fixed a bug that the editor contents could be evaluated while there was still an uncleared result. Now we simply run clearEval()
prior to each eval.
Supports (some) Java interop
Added several common methods from the Character class:
- isISOControl
- isLetter
- isAlphabetic
- isSpace
- isUpperCase
- isLowerCase
- toUpperCase
- toLowerCase
- digit
and Integer/parseInt.
Add browser tests
Uses @vitest/browser. Covers functions:
evalCell
clearEval
evalTopLevel
evalAtCursor
v0.0.18
Bug fix:
- Cursor position would change when cell is evaluated
v0.0.17
refactor to use arrow functions
Bug fix: evalCell
v0.0.16 release v0.0.16
Better errors, prevent infinite loops
v0.0.15 better errors, handle infinite sequences
Revert truncate results
I decided to wait to do this until I come up with a better truncation strategy. Until then, it's a dirty free-for-all.
Pretty print/truncate eval results
v0.0.13 pretty print/truncate eval results