Fork me on GitHub
#cider
<
2017-07-05
>
udit07:07:44

I am getting a spec error when I try to do a cider-jack-in in my project. `Caused by: clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec: In: [0] val: “my-ui.core” fails at: [:args :name] predicate: simple-symbol?` My project.clj has "my-ui.core" as the value for `:main: key. However I am able to run the app via lein run, the failure only happens when I want to do cider-jack-in or cider-jack-in-clojurescript

udit07:07:45

Ah scratch that. I need to unquote the namespace in project.clj

michael zhou12:07:25

Hi.Anyone have idea why I can not jump to function definition source code when coding clojure in spacemacs? Clojure code works.

dominicm12:07:21

@zhoumin79 are you jacking in? So you mean you can't with clojure*script? Are you using boot or lein?

michael zhou12:07:38

yes,when I press “, g g” ,it shows the error “No jump handler..” I run Spacemacs in WINDOWS. Thanks.

michael zhou12:07:35

It cannot jump to external source code.

michael zhou12:07:08

for example, When coding I want to jump to “defstate” in mount source code ,it cannot.

dpsutton12:07:03

what version of emacs are you using?

dpsutton12:07:21

can you tell me exactly which function is bound to , g g?

dpsutton13:07:28

that looks like a spacemacs jump handler is being called

michael zhou13:07:31

spacemacs/go-to-definition

dpsutton13:07:33

do you have the clojure layer installed? it looks like it registers those jump handlers

dpsutton13:07:42

as far as i can tell you're not hitting cider code at all

michael zhou13:07:10

Installed.I find I can go to clojure core source code, but I cannot go to other source code such as mount code

dpsutton13:07:48

have you loaded the namespace before you try to navigate to the code?

dpsutton13:07:57

and are you getting the same error?

michael zhou13:07:40

@dpsutton thanks. It seems like the ns problem. I will try more.

dominicm14:07:46

@richiardiandrea I'm probably not the person to dig into this, but how does a variable become allowed in .dir-locals.el?

richiardiandrea14:07:20

the defcustom declares the type that is considered safe

dominicm14:07:59

So cider-boot-parameters could use :safe #t or similar in it's defcustom?

richiardiandrea14:07:40

Yeah that is something I'd like to discuss with Bozhidar...

dominicm14:07:55

Agree. I can't think of anything particularly malicious that could be done… that couldn't be done by putting things into build.boot anyway

bozhidar14:07:40

Many variables are not marked as safe just because nobody thought of this. Relatively few people use .dir-locals.el.

bozhidar14:07:57

I’m completely fine with making more defcustoms safe.

dominicm14:07:31

I couldn't implement this myself in a timely manner (not an emacs user) but I'll open the cider issue anyway. Would make boot repos simpler for cider users to have this marked as safe.

richiardiandrea14:07:00

I suspect emacs checks also the names and where it finds command it emits a warning...I have this gut feeling

richiardiandrea14:07:06

@dominicm you just need to add :safe #'stringp

richiardiandrea14:07:15

in the defcustom definition

richiardiandrea14:07:28

I'd do it but not now now 😄

dominicm14:07:49

@richiardiandrea that implies I know how to install cider into emacs 😉

richiardiandrea14:07:29

lol sure...you could use vim to just modify the cider repo, no tests...then I will try it 😄

dominicm14:07:14

If that's useful, I have no problem with that 🙂

dominicm14:07:45

Probably quicker in vim anyway.

dominicm14:07:39

cider-boot-global-options looks useful too, adding.

richiardiandrea14:07:29

maybe we need to make all the lein and gradle params safe too?

richiardiandrea14:07:55

and -command...or we wait for folks to complain 😄

dominicm14:07:33

2 approaches really: wait for complaints or open it all up. I don't mind which.

richiardiandrea14:07:57

also maybe cider-default-repl-command and cider-preferred-build-tool... @bozhidar @dominicm up to you 😄

dominicm15:07:02

Even cider-allow-jack-in-without-project looks like it could be useful for .dir-locals.el

richiardiandrea15:07:23

@dominicm cool, I'll review the PR 🙂

dominicm15:07:52

Can't tick any boxes for the PR as I can't even make test (ofc). So I'm just gonna mark you as the culprit 😉

featheredtoast20:07:42

@dominicm thanks for the suggestion re set-refresh-dirs - I'm not sure how to go about calling cider's copy of tns though, sorry

dominicm20:07:02

@featheredtoast cider.inlined-deps.toolsnamespace.v0v3v0-alpha3.clojure.tools.namespace.repl/set-refresh-dirs

dominicm20:07:38

(that will likely move from version to version)