@lee how's the rewrite-cljs coming along?
any reaction from the original author?
FWIW I made a couple of clj-kondo specific tweaks to rewrite-clj which can be seen here: https://github.com/borkdude/clj-kondo/commits/master/parser/clj_kondo/impl/rewrite_clj
The first commit also contains the patch for namespaced maps, I didn't make that an explicit commit
Hi @borkdude, thanks for checking in! I am for now finished with my adventures in cljs, and am back to rewrite-cljc work.
14 days and no response from the original author yet.
we're half way there!
While looking at the namespaced map issue you raised here I looked at your rewrite-clj fork - my compliments in your code, it is very easy to read.
I also took a first stab at docs. Based on an old chat in cljdoc channel, I am trying out asciidoc.
eek @sogaiu! does that mean I have to acutally deliver something? π
lol π
i've been trying asciidoc as well -- today i hit a bit of a snag -- i wrote a README for a repo for an issue and then was about to paste as issue when i learned that github issues don't appear to support asciidoc π went through and rewrote as markdown...
github support for asciidoc is... partial... not horrible... but not wonderful. I am going to leave a minimimal README in markdown and the rest will be in asciidoc.
I think.. at least thatβs what I am going with for now.
i was having a hard time with getting previews to work...finally have something tolerable
Yeah me too. @borkdude likes vscode for this. Iβve settled on a browser plugin that seems to work well.
I haven't tried asciidoc support in vscode though
but it should work, asciidoc is a well established format
Oh I must be misremembering
I do use it for markdown previewing
Ah! my mind is not totally lost. :simple_smile:
@borkdude the issue you brought up with namespaced maps has led me to wonder what I really need to resolve for namespaced maps for sexpr
. Now that Iβve got the code to stop resolving when not using sexpr, Iβm exploring the notion that the current sexpr code might be resolving when it does not have to. Anyways, thanks again for sharing the issue, it has helped!
although I don't use it, my patch does support sexpr
: https://github.com/borkdude/clj-kondo/blob/master/test/clj_kondo/impl/parser_test.clj#L10
but I see your problem there. I cheated a little bit, by always using only one colon π
the information that it's an alias is stored when parsing though, and I leverage that in linting
so in general, for rewriting code, this isn't sufficient, but for clj-kondo it was
well, for rewriting you could probably just emit a double colon again, but for sexpr it isn't sufficient
but how does this work for sexpr on ::foo
right now then?
ah I see:
bar=> (require '[clj-kondo.impl.rewrite-clj.parser :as p])
nil
bar=> (clj-kondo.impl.rewrite-clj.node/sexpr (p/parse-string "::foo"))
:bar/foo
so maybe that makes sense. however, I ran into a bug while parsing, not while doing sexpr I think
maybe the parsing used sexpr, don't remember
the bug occurred when parsing a nested namespaced map
yeah it did on validation
ah
I think the one for me to think about is ::{:a 1}
.
It seems to me that Iβll have to resolve current ns for that one.
yeah, like the keyword example above
but when resolving things like ::p/foo
this should not crash when parsing or rewriting
if p doesn't exist in the context where rewrite-clj runs
I am musing that I might not need to resolve the p namespace alias, but have not had coffee yet. :simple_smile:
I think this topic was brought up before: be very careful with calling sexpr π
you probably can't avoid resolving namespaces from aliases when doing sexpr
Iβll carry on with my exploration and am looking forward to getting back to you after I am caffeinated.
πβ
Oh right, forgot to mention I am starting to look at clj-kondo warnings and even have my very first clj-kondo config! Very cool!
wow nice π
meta π
:simple_smile:
(i tried vscode with a couple of asciidoc extensions, but didn't succeed in getting them to work -- this was after trying some the browser plugin route. that also had problems...oddly enough for files with name "README.adoc"...anyway, now using asciidocfx w/ some success.)
I did have some success with vscode, but I prefer to stay in spacemacs. I found that spacemacs had some oddly teeny tiny default fonts for asciidocs and adjusted accordingly. The chrome browser plugin I am using had to be configured to render local files.
i had to stop using chromium because it refused to start up for me one day...now after quite some time i am back on firefox.
as long as we have strayed this far and since you appear to be using emacs...today i found what i think may be a hidden gem.
I mostly prefer firefox these days too. But did not get asciidoc plugin to work on firefox. I might gry harder.
do tell
it's a socket-repl-based clojure and cljs thing with a set of features that happens to be along the sorts of things i had been making...too bad i didn't find this some months back.
fwiw, i think i tried a firefox-based asciidoc plugin but it was the one that for some reason wouldn't preview files named "README.adoc"
the socket-repl part is important for having something that will work with jvm clojure, cljs, and clojure clr.
And REBL?
haven't tried yet -- just found it π author is quite repsonsive though.
already fixed something i reported.
Is it a cider alternative?
i had to stop using that a fair bit back for various reasons that probably don't apply for other folks -- so i'm not sure. depends on what you use from cider i guess π
i found there were only a few things i really used for clojure work, so if your requirements are along those lines, it may be good enough.
i hope some day we get something with source that provides a complete debugging experience.
do you know of a rebl alternative for cljs? punk was getting closer at one point, iirc.
no sorry, have not even tried REBL yet, but am very intrigued
please try rebl.
will do!
ah, i see i think i misinterpreted the "And REBL?" remark -- it seems like it's not usually hard to add socket-based repl functionality to something.
hope you find it to be worth your time π
I tend to find joy in the journey, so I expect it will!
ah, that is nice!