Quick sanity check. Is there a way to get the core.match/match macro to syntax highlight correctly? The binding variables in particular don't get picked up.
I see this related issue https://github.com/cursive-ide/cursive/issues/1683
Just checking that there isn't a workaround
@olivergeorge No, no workaround sorry.
cfleming: No worries. Thanks for confirming.
@shidima_ has joined the channel
I'm using Intellij with cursive, but it seems to be unable to resolve some of my code (like (db/add-message). I have been watching a video by @yogthos and it seems he has the same problem in the screen cast. So I'm assuming it is normal?
@shidima_ What is db/add-message? Which lib does it come from?
I started a new projcet with lein new luminus guestbook +sqlite +swagger +cljs and import the db namespace as require guestbook.db.core :as db
If you look in that namespace (you can Ctrl/Cmd-click on the ns name), what does the definition of add-message look like?
(ns guestbook.db.core
(:require
[conman.core :as conman]
[mount.core :refer [defstate]]
[guestbook.config :refer [env]]))
(defstate ^:dynamic *db*
:start (conman/connect!
{:datasource
(doto (org.sqlite.SQLiteDataSource.)
(.setUrl (env :database-url)))})
:stop (conman/disconnect! *db*))
(conman/bind-connection *db* "sql/queries.sql")Ok, it looks like itβs dynamically creating vars from that sql file.
Cursive will have problems with that, yes.
Alright, expected behavior then π
Not desired, but sadly expected, yes π
Sometimes its a bit hard to know if I'm doing something wrong or if its part of the tool chain
Thanks for making it clear
No problem, definitely not your fault this time.
@keeds has joined the channel
@shidima_ would u mind sharing which video were u watching. pls? btw, what's the goal with combining mount and dynamic vars? sounds a bit odd to me
@shidima_ i've tracked down where did this (defstate ^:dynamic *db* ...) come from.
it was introduced when mount was integrated into the luminus template:
https://clojars.org/luminus/lein-template/versions/2.9.8.64
at that time (2015-11-18) it used mount:0.1.2 (https://clojars.org/mount/versions/0.1.2)
which came from this commit: https://github.com/tolitius/mount/commit/a7770968dbfa4d010ed3827ce0108db5d0e27741
if you check that out, it does not mention ^:dynamic anywhere in the source code,
so i think the luminus template just carried it around with itself in the hope of maintaining some kind of a backward compatibility, however i think it was simply a breaking change, since they fundamentally changed how *db* should work and what should it mean.
current luminus docs doesn't show any ^:dynamic *db* stuff either:
http://www.luminusweb.net/docs/components.md
intrestingly there is an article from 2015-12-05 from yoghtos where he says:
> Conclusion
> ...
> While it's possible to formalize the handling of stateful resources, using libraries such as component, I personally have not found this to be necessary in my applications.
β https://yogthos.net/posts/2015-12-05-LuminusComponents.html
so in my conclusion, it should just be (defstate db :start ... :stop ...)
i will bring it up on #luminus
I wish I had some sort of hybrid between the repl input pane and a scratch buffer
like, I want to be able to scroll up and down, build up forms piece by piece, edit etc, but I want option+enter to send a require to the repl, not add stuff to an ns form
@bfabry Busy right now but will write more later, I have some ideas around that.
@bfabry +1 for the idea...