This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-27
Channels
- # announcements (14)
- # aws (2)
- # babashka (12)
- # beginners (23)
- # calva (71)
- # cider (37)
- # clj-kondo (47)
- # cljs-dev (3)
- # clojure (55)
- # clojure-brasil (1)
- # clojure-europe (51)
- # clojure-nl (1)
- # clojure-norway (63)
- # clojure-poland (1)
- # clojure-seattle (1)
- # clojure-uk (3)
- # clojurescript (10)
- # conjure (3)
- # cursive (23)
- # data-science (5)
- # emacs (16)
- # events (1)
- # hoplon (16)
- # hyperfiddle (19)
- # introduce-yourself (1)
- # kaocha (5)
- # nyc (1)
- # portal (31)
- # practicalli (2)
- # reitit (3)
- # releases (4)
- # sci (28)
- # slack-help (13)
- # sql (4)
- # squint (40)
- # tools-build (25)
- # tools-deps (10)
I'm having trouble getting my CIDER REPL session to work with AWS credentials (I'm using the Cognitect AWS API library). For context, I'm using AWS SSO and don't want to use API keys.
I found this old https://github.com/cognitect-labs/aws-api/issues/182 about AWS SSO not supported by the Cognitect library.
I'm now trying to use aws-vault
which has a --server
option which basically emulates the EC2 metadata http endpoint for fetching tokens locally. But this method only seems to works in the shell session where it was launched, so my CIDER REPL isn't able to use it.
Any suggestions?
Yes, staring a cider/nrepl server from your terminal and cider-connect
ing later would seem simplest
Perhaps you'll get to appreciate it ๐ I favor it (maybe 80-20% vs jack in) as it survives emacs crashes
Exactly this (well, I do it more than 80%) > I favor it (maybe 80-20% vs jack in) as it survives emacs crashes
@U050S5ZET There is another way. The default credentials provider also looks at these system properties:
aws.accessKeyId
aws.secretKey
aws.sessionToken
You can set those within the REPL, taking the values from the respective env variables in a shell that is logged in:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
I like this approach better because my AWS session is short-lived, and I hate to restart the REPL just to refresh the credentials. To facilitate this approach I wrote a couple of helper scripts and functions for myself, it's too specific to share but I'm sure you can do something similar if you want to go this way.One caveat: credentials provider checks system properties after env variables, so you have to make sure that the REPL process is started where those envs are NOT set, otherwise the properties will be ignored.
Is it possible to remove the new syntax highlighting on protocols inside deftype forms? Not sure if this is a CIDER or clojure-mode issue
This is CIDER 1.8.4-snapshot, no idea on the exact commit but I will look for it soon
I can repro. The logic responsible for this is (and do-var (not is-function) (not is-macro))
in cider-mode.el
That do-var
is truthy should not happen given your custom cider-font-lock-dynamically
. Do you set it in a funny way?
I set it via custom-set-variables
in init.el before CIDER is started
I hint this b/c we have this logic
(let ((cider-font-lock-dynamically (if (eq cider-font-lock-dynamically t)
'(function var macro core deprecated)
cider-font-lock-dynamically)))
...)
so make sure it's not t
at any point. Try debugging to confirmThe way I have CIDER (and clojure-mode) set up is with straight.el and use-package like so
(use-package cider
:commands cider-jack-in
:config
(setq cider-use-tooltips nil
cider-lein-parameters "with-profile +dev repl :headless :host localhost"))
For what itโs worth, CIDER 1.7.0 release does not have this problem. Unfortunately, that does not help us bisect the bug much ๐
I am going to try looking at syntax highlighting by progressively updating versions of CIDER from 1.7.0 and let you know when I first see the change
We'll refined cljs a lot. In fact I can confidently state that a few things worked by chance, others were plain broken A side-effect is that if you were very used to this or that aspect, now it may be different
Truth be told the 'bug' seems a feature to me. Which doesn't mean we can't investigate it
At *nrepl-messages*
level, you'll see a changed-namespaces property with IAtom in it
Its value is:
(dict doc "\"Marker protocol indicating an atom.\"")
It lacks fn "true"
or macro "true"
indicators. Which seems correct for a defprotocol
yeah, I was used to the protocols simply not having any highlighting, but now that only happens to Object
(at least in the case of CLJS)
I'll give it a 10-20m debugging session, else chances are I'll have to give up, it's a comparatively minor problem. Let's see!
No need. I understand that supporting the case of Object
is tricky since this is CLJS-specific. IIRC JVM Clojure has its own way to add custom methods to a type, but itโs probably using a different symbol
Debugged โ
and, as suspected, nothing was really broken... rather, things are starting to look as intended
This section is the responsible for the behavior you're seeing https://github.com/clojure-emacs/cider/blob/6baa3c3f315f1dc822d39a90dd5840386f97e954/cider-mode.el#L809-L811
The rationale, I guess, is that core
means all of clj/s core, no exceptions. Users in principle don't get a say as to what belongs to core
.
You are free to remove core
from cider-font-lock-dynamically
- it's a defcustom ๐