Open benjamin-asdf opened 1 year ago
It would be nice if we can concentrate the logic here indeed.
The browser server handles describe
, but which ops are actually implemented is defined on the handler side.
Suggested naming:
So client
<- browser-server
-> nrepl-handler-server
(scittle.nrepl).
If I want to add eldoc
, I want to advertise the supported op
(ops in describe
).
server-handler
can use).1.
downsides:
2.
downsides:
sci.nrepl
describe
I'll get back to this hopefully soon.
@benjamin-asdf
I think we need to move the describe response to the implementation (scittle) rather than this dependency since it will depend on the implementation what it supports.
As for eldoc: we can put the common eldoc handler in sci.nrepl and then you can hook it up in the implementation, similar to how completions work.
nbb has a slightly more sophisticated eldoc handler than what you described:
Yes this makes the most sense :+1:
I guess we already know that nobody else is using sci.nrepl
except the scittle repl? Because it would be a braking change if they update sci.nrepl.
. They then need to implement describe
else tools would break.
I plan to tackle moving describe
and implement an eldoc for scittle repl in the comming days.
sci.nrepl
isn't really used beyond scittle. There is an open PR in Clerk that adds the same nREPL support as scittle to it, but I can easily change that.
How to handle the ops list? Currently, if I add additional ops handled by the implementing nrepl-server,
1) we also need some scheme to know about the ops.
2) Or we flow all ops through to the nrepl-server and expect it to complain about unkown ops itself?
maybe 2
is the simplest and easiest.
I would then not complain about unkown op in browser_server and assume the nrepl-server is handleling ops / unkown ops.
I don't fully understand the consequences of either, so just go with the easiest option and we will change if necessary
eldoc in scittle! haha
not all core functions have meta
data. str
for example does not.
not all core functions have meta data. str for example does not.
This is because scittle is compiled with SCI_ELIDE_VARS
which is a setting which leaves out docstrings and arglists for core vars to save space.
Currently we have this 2 layer solution for the sci nrepl that talks via websocked to e.g. scittle nrepl. I would like to implement
eldoc
for scittle so I would have to add it both here and there; Sounds like trouble. In the case of eldoc we might be able to implement in terms of sci.nrepl. Because it only needs to evalI guess the whole point of sci.nrepl is to try to not have to reimplement the same stuff for each project.