Fork me on GitHub
#cursive
<
2024-03-12
>
Ernesto Garcia12:03:01

Hi. Cursive doesn't seem to apply the correct type hints when functions with type-hinted return value are used inside a threading macro without parentheses. For example, it's displaying a warning for:

(-> from-date
  dates/to-instant
  (.truncatedTo ChronoUnit/SECONDS) ; warns "clojure.lang.IFn.truncatedTo cannot be resolved"
  dates/to-iso)
but not for
(-> from-date
  (dates/to-instant)
  (.truncatedTo ChronoUnit/SECONDS)
  dates/to-iso)

onetom03:03:57

and by the heartpulse emoji, i mean it's exciting! especially with the interop enhancements upcoming in clojure 1.12, it should be much smoother to blend clojure with the java ecosystem. the past year i had to explore the java.net.http, java.time & java.nio.file packages and it was quite cumbersome without being able to rely on cursive's auto-completion and quick definition. it meant i couldn't easily expect my colleagues to do such exploratory work because of this friction.

cfleming07:03:05

I’ll also try to write a doc page about the interop features.

Ernesto Garcia07:03:17

> the past year i had to explore the java.net.http, java.time & java.nio.file packages and it was quite cumbersome without being able to rely on cursive's auto-completion and quick definition Cursive does already suggest Java methods. What are you missing there?

onetom08:03:10

but it doesn't always suggest java methods. i thought the example u showed was such a case too.