This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-25
Channels
- # announcements (4)
- # beginners (26)
- # calva (18)
- # cider (24)
- # clojure (35)
- # clojure-brasil (9)
- # clojure-dev (6)
- # clojure-europe (39)
- # clojure-madison (1)
- # clojure-nl (1)
- # clojure-norway (100)
- # clojure-uk (6)
- # clojurescript (17)
- # data-science (15)
- # datalevin (5)
- # emacs (1)
- # events (2)
- # introduce-yourself (2)
- # javascript (1)
- # malli (28)
- # missionary (7)
- # off-topic (59)
- # polylith (20)
- # reitit (2)
- # releases (1)
- # remote-jobs (2)
- # rewrite-clj (5)
- # shadow-cljs (27)
- # sql (5)
- # squint (63)
- # xtdb (8)
is there a way to have some sort of autocompletion for java methods on non core objects?
also cider-javadoc is not working unless it's a standard library class atm, even though cider-enrich-classpath
is t
, I think I saw it working before for non standard library classes
(:import (org.apache.kafka.clients.consumer ConsumerRecord)
(org.apache.kafka.clients.consumer MockConsumer)
(org.apache.kafka.clients.consumer OffsetResetStrategy)
(org.apache.kafka.common TopicPartition)
))
(def topic(def mock-cons (MockConsumer. OffsetResetStrategy/EARLIEST))
if I create a MockConsumer object from the kafka library for example
both javadoc and auto completion are not working
auto completion is still tricky I guess since I have to use the (.method object)
syntax
(.method object)
completion should work, even in the absence of enrich-classpath
The trick is, type hints should be in place
cider-javadoc in particular doesn't work, simply because nobody tried https://github.com/clojure-emacs/cider/issues/3619 But java docs are available in completion and in the Inspector. The result is much better than what javadocs could be - let me share a demo
https://clojurians.slack.com/archives/C0617A8PQ/p1699381762708279 (in the post below of that there's a description)
And here's the demo for completions https://clojurians.slack.com/archives/C0617A8PQ/p1696618492372739?thread_ts=1696618492.372739
For object member completions to work, you either need to import that class into the current namespace, or type-hint the symbol you're completing members for and use (.method object)
syntax.
Yeah I do have the classes available in the namespace
And I use corfu , I wonder if last time I saw it working correctly I was using company
Actually I think it doesn't anymore
Mm yeah what can it be then?
I wonder if it's because I'm only getting auto completion from lsp and not cider
I wonder if it's because I'm only getting auto completion from lsp and not ciderwell, if your setup is configured that way, then it's no wonder 😄 Corfu integration is a touch more complex than Company. It depends more on the "completion style"
See https://github.com/clojure-emacs/cider/pull/3504 or take a look around the issue history IIRC last summer we finally fixed and documented this area, but if you find that's not the case please raise an issue.
oh interesting I changed a few things and I do get proper completion in the repl
but not in a clojure file
not sure why I switched anyway 😄