Fork me on GitHub

@pez in processing clj-ish files from github using tree-sitter or clj-kondo, here are a few things that come up that can lead to errors / warnings: * template files - people do things like: (ns {{namespace}}.rendering or :{{name}} (mustache?) -- small number of instances of other styles too * missing, misplaced, or incorrectly placed closing delimiters * non-clojure text in (comment or #_ blocks * questionable(?) symbols and keywords - things that the repl might accept, but for which i didn't find a statement of support (e.g. # in keywords, keywords with multiple slashes in them)


Thanks! I've saved these observations. Working with setting up tests for Calva's paredit lexer right now.


Do people still name the template files .clj/cljs?


in short, yes. i don't know if other file extensions are used for template files -- i'm only testing files named .clj, .cljs, and .cljc.


in the samples collected, i have about 100,000 .clj files, 20,000 .cljs files, and 8,000 .cljc files.


Haha, awesome. Publishing it as a repo of it's own? I have just made some changes to my paredit lexer/cursor and it would be nice to have a sea of real world samples to throw the changes at.


the total size of what was fetched is over 30 gigs

😱 4

i adapted andyfingerhut's recent investigation work to come up with the git repository urls to fetch and then fetched them:


Here's a demo of the changes, btw. I want data readers to be toknized together with the forms they annotate. As my lexer is line based, I can't have it fully my way when the reader marker is on a line of its own. But for that I modified token cursor a bit so that at least it navigates correctly for the basic forward/backward sexpr cases.


i guess here, "reader marker" == "tag" (e.g. #foo)


It also makes us highlight ignored data reader annotated forms correctly.


Yes, maybe they are called tags.


ah yes, i see the stacked discard / ignore forms and the subsequent gray coloring.


Exactly. In current Calva an ignore form will only grey out the tag.


Also in that gif is shown that if the tag is on the same line as what it tags. Paredit drag-up and push-down sexp works also in the presence of tagged list forms.


But not when the tag is on the previous line, but hey. ¯\(ツ)


that sounds like it would be nice if it worked better, but i confess to not being a paredit or parinfer user, so it wouldn't affect my use 🙂


I'm such a Paredit junkie that I will eventally make a paredit extension that works for all programming languages I use. It's horrible not having it in html/js/css and such.


i do use some structural navigation features in some editors, but i find that i don't use most of the other features. i also find the keybindings chosen in various places to override some basic sequences that i have been using for other things so i end up not using it so often. perhaps if i could find a simple enough extension or write one myself i'd use this type of thing more.


i guess you must use a lot of paredit's features 🙂


Calva's keybindings for paredit are pretty carefully choosen. Just sayn'


i agree tree navigation and editing would be good in non-lisps too.


I end up learning them as I test the stuff I create. 😃


in vscode i use ctrl-home and ctrl-end to go to the beginning and end of an editor respectively. this also works in some other places.


i don't want to give up that type of thing.


”Why are people nagging me about raise sexp?” ... implementing it anyway_ ... ”Oh, that's why!” ,,, can't live without it.


ctrl+home/end still works with Calva paredit, no?

sogaiu13:03:55 suggests they are bound to something else -- or may be i misunderstand?


Yeah, you are right. It's a bit of a mistake, since I am a mac user and use cmd+home/end.


i appreciate this bit of advice though:

If you are new to Paredit, consider starting with learning the Slurp Forward (pull in the next form into this form) and Barf Forward (push the last form out of this form). It will take you quite far.


that's pretty much all i use for the editing part.


i end up having to do things on multiple platforms and some things are quite hard to shake -- on windows there is a fair bit of this type of stuff.


But you can rebind those. And I can consider making a keymap where I correct that mistake.


i used to rebind, but i don't any more -- it doesn't seem worth it to me.


so i tend to forgo features or use the command palette.


i find i can remember the names of commands or locations in menus better than key sequences.


Yeah the command palette is a saviour.


it really is helpful.


i use helm when using emacs.


i was a die-hard quicksilver user when i used to use macs more frequently.


Dear Calva-friends: A new Calva is out - v2.0.79. Main change is that reader tag thing mentioned above, and summarized here: It is a rather foundational change, so please be alert and let me know if something that used to work seems broken. The release also brings a change in the tmLanguage grammar regarding highlighting of keywords. They are now actually highlighted by most vscode themes.

calva 4