Fork me on GitHub
#cursive
<
2023-12-08
>
Ryan02:12:06

Another thing I’ve been meaning tget to the bottom of, is there a way to get it to resolve my js requires? e.g.

Ryan02:12:36

(ns file.test
(:require ["primereact/toast" :refer [Toast]]))

[:> Toast {:class "blah"}]

Ryan02:12:24

In this example, cursive can’t resolve Toast.

cfleming06:12:17

Sadly no, but I’m going to investigate this (yet again) soon.

p-himik08:12:10

Just stumbled upon this as well after renewing to the latest version - was really hoping for this to be fixed. :D Even stuff like js/cancelAnimationFrame still isn't resolved properly. If there's no straightforward way to properly resolve JS things, personally I would be comfortable with a stop-gap measure of specifying such names yourself, either in the js/.../`(.xxx js/window ...)` context or in the context of any JS type.

p-himik08:12:24

Tried editing the symbol resolution scheme XML manually - no dice.

cfleming09:12:26

My plan initially is to just not complain about the resolution failing for JS forms. But that still won’t help with documentation, navigation etc.

p-himik09:12:28

Yeah, that by itself would already be a great improvement. Other things are much less important, at least to me.

p-himik09:12:27

Also, the highlighting category of resolution errors seems to be wrong. It's just a generic "Warning", but seems that "Unknown symbol" would be a better fit.

steveb8n03:12:28

The “next big thing” question: how amenable is Cursive/Clojure to the new Intellij AI service?

steveb8n03:12:14

e.g. I’ve been wondering for a while if Clojurists will suffer being less mainstream because the LLM aren’t fine tuned to our languages

steveb8n03:12:43

Is it correct to assume that IJ features are all built off an AST so the AI service will need to grok a Clojure AST first?

cfleming06:12:41

Not so much, but it’s unfortunately true that their service doesn’t support Clojure well. I asked about integrating into it but they weren’t interested. I have plans to investigate a simple integration if you supply your own GPT key though, GPT 4 works pretty well for Clojure these days.

Anders Corlin14:01:07

I'm using the trial version of the JetBrains AI-assistant, and I must say I'm impressed how well it works with Clojure! Asked for a commit message, and it describes pretty well what I was working on:

Update push notifications handling for iOS users

This commit modifies the deeds API handling of push notifications, specifically for iOS devices. It introduces the function `get-push-token-os` to determine the operating system for a given push token. It also updates the function `get-deeds-user-keys-push-tokens` to compute the unread notification count specifically for iOS devices.
I asked it for improvements of an existing function, and it broke it down to a couple of smaller functions with relevant function names. Asking for potential problems - didn't find so much, it wanted to add more null checks, which was actually not relevant since null values work much smoother in Clojure than in Java. Final test: Write a function that loads users from Datastore and filters by email address as specified by input parameter
(defn load-users-by-email
  [email]
  (ds-load :user {:filters [[:emailAddress email]]}))
Now this is scary!! It understands both that ds-load is our proprietary function that we use for loading from Datastore, the syntax of this proprietary function as well as the datamodel.

👀 1