This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-06-02
Channels
- # announcements (11)
- # babashka (3)
- # beginners (54)
- # cherry (1)
- # cider (11)
- # clojure (28)
- # clojure-europe (1)
- # clojure-norway (4)
- # clojure-sweden (3)
- # clojurescript (40)
- # community-development (3)
- # cursive (12)
- # datomic (2)
- # emacs (6)
- # hyperfiddle (12)
- # missionary (14)
- # off-topic (13)
- # overtone (10)
- # re-frame (13)
- # releases (1)
- # ring (2)
- # specter (11)
- # tools-deps (7)
Does cider-enrich-classpath work in deps.edn projects? I normally set up Leiningen projects, but I am quickly experimenting with something, so I am simply using an empty deps.edn file as a project. I have cider-enrich-classpath
set to t
but I notice that completion for java.*
classes does not work inside :import
clauses of ns
forms. This has always worked for me with Leiningen projects since I ever started with Clojure (and CIDER). Using Emacs 29.2 and CIDER 1.15.0-snapshot
A couple of points here.
• Classname completion never required enrich-classpath. It works out of the box in CIDER, but you have to enable flex
completion style (it used to be done via other functions and hooks, now flex
style is the proper way). Please see https://docs.cider.mx/cider/usage/code_completion.html#fuzzy-candidate-matching
• Sometime ago the completion Classname -> fully.qualified.Classname
started working anywhere in the file, not just inside :import
clause. GIve it a try sometime!
Also curiously, both project types "just work" when autocompleting outside of the :import
clause
This is gonna be tough to make a MRE for. There is probably something wrong with my Emacs config
Enrich helps with other things like displaying documentation during completion, and adding sources so that jump to definition works
@U0479UCF48H Could you please do M-x nrepl-toggle-message-logging
, try triggering completion inside :import
form, then switch to *nrepl-messages*
buffer, and check the response for op "complete"
?
Here is one example message
(-->
id "40"
op "complete"
session "aa5ed3cd-8bcf-47c0-8cb8-e67765215f9b"
time-stamp "2024-06-02 15:15:15.808837000"
context "(ns user
(:import (java.util.zip GZIPInputStream)
..."
enhanced-cljs-completion? "t"
ns #("user" 0 4 (face font-lock-type-face cider-block-dynamic-font-lock t cider-locals nil fontified t))
prefix #("java.util" 0 9 (cider-block-dynamic-font-lock t cider-locals nil fontified t))
)
(<--
id "40"
session "aa5ed3cd-8bcf-47c0-8cb8-e67765215f9b"
time-stamp "2024-06-02 15:15:15.819986000"
completions nil
status ("done")
)
the context is the following code
(ns user
(:import (java.util.zip GZIPInputStream)
(java.util |))
(:require [clojure.java.io :as io]))
the |
indicates where my cursor was when I pushed the tab keyTwo new fun features have landed into CIDER rolling MELPA, both related to CIDER Inspector.
Toggleable view mode
The inspector now has a keybinding for toggling between the "view modes" – v
. Just two view modes are currently present: :normal
(default) and :object
. In object view mode, any value, even if it's a recognizable "data" value (collection, string, etc.), will be rendered as a Java object together with its fields. This can be of great use when you develop custom data structures or want to explore how Clojure's and Java's own data structures are implemented. See the screenshots for examples.
Note: view mode is reset back to :normal
when you drill down to another value in the inspector; but it will switch to the previous mode if you go back to the value with l
.
Note: On JDK 17+, the private fields that belong to the JDK classes will unfortunately be empty (or even missing) unless you add a bunch of --add-opens
statements to your startup command.
Class hierarchy
When inspecting a class, you'll now see all its class hierarchy at once. At the top, there will always be a chain of superclasses, and the rest are interfaces that the class directly or transitively implements. All the classes in the hierarchy are clickable, so they can be drilled down further.
