Fork me on GitHub

@mattmorten Oops, sorry, I initially thought that was what you were talking about, then realised it was probably JVM but didn’t go back to edit my message. Yes, I mean JVM.


@dnolen Standard navigation should work, Cmd-Click sorry, not Ctrl-Click.


@dnolen e.g. if I have the following:

(s/def ::date inst?)

(s/valid? ::date (java.util.Date.))

(doc ::date)


Then from the usages of ::date in the second and third lines I can Cmd-Click to go to the definition on the first line, and find usages etc works too.


If that’s not what you mean, let me know.


So it doesn’t work for ClojureScript specs?


I already had an opened Clojure project when I decided to open another one in another window. I was immediately greeted by the cheery "Indexing..." but not only in the second window - also in the first one! I can see this in IDEA logs:

INFO - il.indexing.FileBasedIndexImpl - Rebuild requested for index ClojureSymbolMeta 
        at com.intellij.util.indexing.FileBasedIndex.requestRebuild(
        at cursive.intentions.resolve$rebuild_all_indexes_BANG_.invoke(resolve.clj:142)
        at clojure.lang.Var.invoke(
        at cursive.api.DelayedFn.invoke(
        at cursive.settings.ClojureProjectResolveSettings$loadState$
        at com.intellij.openapi.application.impl.ApplicationImpl$
        at java.util.concurrent.Executors$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$
Why though? Why does Cursive have to rebuild-all-indexes! (my guess is that's the culprit) when I open a project and rebuild the indexes of the already opened project?


And if I open 5 projects? I won't even try - my laptop doesn't have enough RAM.


@dnolen It does work with CLJS, I just tested that exact code in a CLJS ns and it worked. Are you seeing something different?


@p-himik I’ll take a look at that, but I think that is because indexes are a curious mix of global and project-specific in IntelliJ. Clojure is an unusual case in that the contents of the index require configuration (in this case, you configuring which forms def global things) in order to index correctly. Almost no other language is like that. When that configuration is changed (in this case, by loading a project which customises resolution) I have no choice but to invalidate the index and reindex, which I think is a global operation.


Note that it will only reindex Clojure indexes though, not e.g. Java ones.


But I will check when I have the code in front of me to check my understanding.


Thanks! > configuring which forms def global things But how can a project influence another, completely unrelated, project in such way?


It can’t really, but when that config is changed I have to force IntelliJ to reindex, and it’s not designed to do that in a project-specific way.


(again, I think)


I see, thank you. Yeah, it's been my pet peeve (and not mine only) when it comes to reindexing in IDEA - you can't make it reindex a single project via UI. And not being able to do that even in code explains that.


Yes, it’s because the indexes are actually global, but when you retrieve values for them you restrict the set of files it searches to a particular project.


It’s possible I could force it to just reindex a particular set of files, but I’d have to look at whether that’s possible.


@cfleming and it works when the spec is in a different file?


Is there a way in Cursive to search a function through its fully qualified name?


@viebel in what context? Like, find usages?


or go to declaration


I’ll just spew out what I know 🙂


1) If you’re looking at a usage, and you want to jump to declaration: Navigate -> Declaration


2) If you have a declaration, and you want to find usages: Edit -> Find -> Find Usages


3) If you only have a fully qualified name (i.e. you’re not looking at a usage) and you want to go to declaration, the easiest thing is probably: Navigate -> Symbol


note that this doesn’t support fully-qualified symbols like you asked, but it tends to narrow it down pretty well for me


4) If you really wanna search by fully qualified symbol, you can type it into a clj file and: Navigate -> Declaration


I know 4) is directly closest to what you asked, but I thought you might find it useful for me to give an answer in order of what I actually use most.


@dnolen The following appears to work for me: keyword :a/foo (kw ns is from ns A), spec in ns B, at a usage in ns C: Navigate -> Declaration goes to spec in ns B


I see what's going on - this doesn't work for deps.edn git libs


@potetm Thanks for the detailed answer. Navigate -> Symbol is the closest to what I need. But it is a bit annoying that it doesn’t support fully qualified name. My use case is that I look for the a function named audyx.body.patients-autocomplete/init and when I type init in the Navigate -> Symbol, I get lots of suggestions: I am wondering why fully qualified name search is not supported/


yeah, a “nav to symbol” that works like the “nav to namespace” would be bananadance


also, wtf, I just learned about “nav to keyword”


I assume if “nav to keyword” is possible, “nav to symbol” should be as well


It should even be simpler. What do you thing @cfleming?