-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jack-in support for the Basilisp Clojure dialect in Python #3683
jack-in support for the Basilisp Clojure dialect in Python #3683
Conversation
4fe1e80
to
8e99af4
Compare
The PR looks good to me overall, sans my small remarks. Does Basilisp implement the nREPL protocol fully? I'm wondering if there are some caveats that need to be documented if some ops are not implemented. |
removed obsolete option.
The Basilisp nREPL server currently implements the followings ops: |
f693f28
to
f48f0e2
Compare
I've just realized that jacking in on MS-Windows won't work even in a user session (I left a
|
I'm guessing you mean |
Hi @bbatsov, I've checked in an update referencing the latest basilisp version with the recently released fix (thanks @chrisrink10). All tests now pass.
I failed to mention earlier that the nREPL server is a port of the nbb nREPL server. I've kept the same ops, minus the I haven't looked at the standard supported ops, but I'm reluctant of remove or renaming anything at this stage in fear I might break Calva support. I'll clean it up in the next basilisp nREPL update. By the way, the thanks (-->
id "3"
op "describe"
session "b8a83d6d-84ee-4ab3-a1c0-92cd548634cf"
)
(<--
id "3"
session "b8a83d6d-84ee-4ab3-a1c0-92cd548634cf"
ops (dict
clone (dict)
close (dict)
complete (dict)
describe (dict)
eldoc (dict)
eval (dict)
info (dict)
load-file (dict))
status ("done")
versions (dict
basilisp (dict
incremental "1"
major "0"
minor "."
version-string "0...1...0.b.2")
python (dict
incremental "1"
major "3"
minor "12"
version-string "3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]"))
)
(-->
id "10"
op "complete"
session "b8a83d6d-84ee-4ab3-a1c0-92cd548634cf"
context "nil"
enhanced-cljs-completion? "t"
ns "user"
prefix #("printl" 0 1 (fontified t) 1 2 (fontified t) 2 3 (fontified t) 3 4 (fontified t) 4 5 (fontified t) 5 6 (font-lock-multiline t fontified t))
)
(<--
id "10"
session "b8a83d6d-84ee-4ab3-a1c0-92cd548634cf"
completions ((dict "candidate" "println" "ns" "basilisp.core" "type" "function")
(dict "candidate" "println-str" "ns" "basilisp.core" "type" "function"))
status ("done")
)
(-->
id "11"
op "eldoc"
session "b8a83d6d-84ee-4ab3-a1c0-92cd548634cf"
context "nil"
ns "user"
sym "println"
)
(<--
id "11"
session "b8a83d6d-84ee-4ab3-a1c0-92cd548634cf"
docstring "Print the arguments to the stream bound to :lpy:var:`*out*` ..."
eldoc (nil
("x")
("x" "&" "args"))
name "println"
ns "basilisp.core"
status ("done")
status ("done")
type "function"
)
|
CIDER users both it's own ops (if present) and the standard nREPL ops if they are not. In general I think it's best for most nREPL implementations to stick to the official ops for completions and lookup, as this means they would work with more clients. I'm reasonably sure Calva supports
|
Hi @bbatsov
Is this the official list of operations supported by the nREPL protocol that servers should adhere to? https://nrepl.org/nrepl/ops.html
That would be very helpful indeed. |
Hi,
can you please consider merging this patch to support Basilisp jack-in in CIDER. it resolves #3682.
I have added added an integration test and updated the documentation accordingly.
Currently the integration test currently fails on MS-Windows and has been temporarily disabled. This issue is addressed by basilisp-lang/basilisp#865 but the fix has not been released yet in PyPi. The problem is related flushing the stdout after a
println
. It only fails in CI, but works fine when invoked from a user's session.Additionally, it requires
clojure-mode
v5.19 to support recognizing Basilisp's.lpy
file extensionThanks
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.Thanks!
If you're just starting out to hack on CIDER you might find this section of its
manual extremely useful.