cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code
579 stars 7 forks source link

Namespaced keyword "Navigate to Declaration" and "Find Usages" do not work outside of CLJC files #1913

Closed shaunparker closed 5 years ago

shaunparker commented 6 years ago

Clojure Spec definitions defined in CLJC files do not work with "Navigate to Declaration" or "Find Usages" in CLJ and CLJS files.

Steps to reproduce:

  1. Create specs.cljc
    
    (ns specs
    (:require [clojure.spec.alpha :as s]))

(s/def ::name string?)

(def the-best-person {::name "Jane"})

2. Create ```example.clj```

(ns example (:require [specs :as specs]))

(def people [{::specs/name "John"} {::specs/name "Jane"}])


3. From ```example.clj``` navigating to the ```::specs/name``` declaration doesn't work. Viewing the usage only shows the two usages in the ```example``` namespace.
<img width="769" alt="screenshot 2017-12-06 15 32 55" src="https://user-images.githubusercontent.com/195140/33688966-c76319f8-da9a-11e7-985b-85da12994ea6.png">

4. From ```specs.cljc``` file, navigating to the ```::name``` declaration works, but finding usages only shows the usage in the CLJC file, not the two in ```example.clj```.
<img width="504" alt="screenshot 2017-12-06 15 33 56" src="https://user-images.githubusercontent.com/195140/33689035-0ae3ba8e-da9b-11e7-9c70-88e91e7dd68a.png">

5. Convert ```specs.cljc``` to CLJ.

6. "Navigate to Declaration" and  "Find Usages" work properly.
<img width="693" alt="screenshot 2017-12-06 15 37 15" src="https://user-images.githubusercontent.com/195140/33689097-5aedbdea-da9b-11e7-9331-b79aa4227b88.png">

<img width="705" alt="screenshot 2017-12-06 15 36 42" src="https://user-images.githubusercontent.com/195140/33689082-46744e92-da9b-11e7-8eea-10684f037652.png">
konstan commented 6 years ago

The issue id still there with

Cursive 1.7.0-eap1-2018.1

on

IntelliJ IDEA 2018.1 (Community Edition) Build #IC-181.4203.550, built on March 26, 2018 JRE: 1.8.0_152-release-1136-b20 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.12.6

Not being able to properly browse through the definitions on complex projects creates a lot of unnecessary friction by requiring to do manual full-text searches / browsing. Would be cool to have a fix for that. Thanks.

shaunparker commented 6 years ago

Any updates on this? I'd really love to be able to not have to do this navigation manually.

Thanks, Shaun