Comments (6)
Ohhh that could be neat, I'd probably print them under some other "type" of message in the log so that users could blacklist it separately to stop it opening the log window.
I'd say it can't hurt, the only problems could be if the client connecting expected the prepl to behave exactly like a normal prepl, people need to build their clients to log or ignore unknown messages.
Mine is built on assumptions that I'll only see one :ret and only after I've evaluated a single form, for example. But I could see out, tap or err at any time.
I'd say go ahead, can't hurt! I think!
from conjure.
Good to know.
It might make sense to accept multiple :ret
values in case it is possible for the user to send 1 2 3
directly to the REPL socket. Not sure how much parsing you do on your end.
I'll try to make a wiki page of all the possible "extra" prepl messages you might receive.
from conjure.
So if you send multiple forms you will get multiple :ret
values, Conjure however wraps all evaluations to ensure multiple forms (such as an entire buffer contents or visual range eval) will always return one thing.
In Clojure it does this by passing the raw string wrapped in some code to evaluate it with the correct source file / line / column set. This means the code sent to the prepl is actually one form, no matter what, that contains the code to evaluate your code. If that makes sense?
In CLJS I try to work out if you have a single form or many, if I am sure you're sending one form it's sent as is, no modifications are made other than switching to the correct namespace for the eval. If you send multiple forms they'll be automatically wrapped in a do
which could cause issues in some rare cases, but the only one I know of is some specific namespace form evals.
If I started using self hosted CLJS (which I think would bring a whole host of complications) then I could do the wrapped eval just like I do in Clojure, which would be nice. I don't think I can do self hosted CLJS and have all the require loading etc just work out of the box... I think you know more than me about that though, maybe self hosting would be a good route for CLJS evals.
Then I think I could set the file / line / col for different evals which would be 👌
Super excited to see prepl getting "native" support in shadow though!
from conjure.
Even self-hosted can't get past the limitations of the CLJS REPL. You can find the REPL specials here and those wouldn't work when wrapped in a do
.
Most of those can't work like Clojure because almost all IO is async in JS so a require
that needs to load namespaces from somewhere first would need to take a callback before proceeding. In Clojure require
is blocking and you can immediately use the new ns.
I believe the default CLJS repl impls (eg. browser) are still buggy and evaluating (require 'some.ns) (some.ns/foo)
too quickly would fail if there isn't an accidental "wait" time after the require
.
from conjure.
Yep, of course. So if you eval the file or you eval that single form it'll be fine. If a user tries to eval multiple forms from a range or block it'll cause issues but I think that's okay. There's some... interesting... workarounds I could do for evaluating the whole buffer from memory (not from disk) for example, but for the most part it all works fine.
Generally when I'm editing CLJS I use <localleader>ef
a lot which translates to a load-file
call, that produces nice results with the "go to definition" information intact.
I don't require any sync require
as part of Conjure, so I'm okay on that front 🙂
from conjure.
Going to close this issue for now since I don't think there's much else to say. If you want to send some extra values I'd be happy to render them 😄 I'll make sure there's a catch all for non-standard prepl messages.
from conjure.
Related Issues (20)
- [Clojure] Defining custom/alternative test runner HOT 5
- Regression on the `develop` branch since 5119706fa08ecb1efa72fb9d6e68bb965d259015 HOT 3
- Other floating windows overlap HUD HOT 1
- How can I write a conjure client without aniseed? HOT 5
- How do I connect to a Fennel REPL via port? HOT 3
- Connection resets upon evaluation on Windows for Janet + Netrepl HOT 4
- Disable all default mappings? HOT 11
- [Feature Request] Add Tangerine support (Fennel)
- Duplicate kondo messages with Lazy and your provided config HOT 7
- Randomly losing keymaps HOT 1
- Clojure: evaluate word misinterprets single-quotes in symbol names HOT 6
- [Clojure]: A way to configure a default namespace HOT 6
- Swap `__name__` to something other than `__main__` in Python REPLs HOT 3
- README Suggestion HOT 2
- Cannot connect to Scheme through socket HOT 2
- Async/await doesn't work with ipython REPL HOT 13
- stdio repl handling of both stderr and stdout for a form can be a problem sometimes HOT 1
- <localleader>ee, <localleader>E evaluate the whole file HOT 9
- Problems with evaluation: wrong returns HOT 3
- Guile over nREPL, guile-ares-rs integration HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conjure.