cursive-ide / cursive

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

overlapping externs confuse #1477

Open timothypratley opened 7 years ago

timothypratley commented 7 years ago

When a CLJS package contains multiple externs, not all of them are used e.g. [cljsjs/firebase "3.2.0-0"] https://github.com/timothypratley/voterx in voterx.firebase

(defn sign-in-with-popup []
  (.signInWithPopup
    (js/firebase.auth.)
    (js/firebase.auth.GoogleAuthProvider.)))

js/firebase.auth is recognized, but not js/firebase.auth.GoogleAuthProvider.

GoogleAuthProvider comes from node_modules/firebase/externs/firebase-auth-externs.js, which seems to not be loaded by Cursive despite being in the deps.cljs :externs list But js/firebase.auth is fine, which comes from cljsjs/common/firebase-server-auth-externs.ext.js

timothypratley commented 7 years ago

As an additional clue, removing firebase-server-auth-externs from the :externs list in deps.cljs doesn't help, but removing the file altogether does (though clearly this is not the right thing to do)... which suggests that the problem occurs when 2 ext.js files define the same root object???

timothypratley commented 7 years ago

Aaaaaand now everything is working fine when I put them all back in a jar. Sorry I guess I don't understand what is going on at all

timothypratley commented 7 years ago

Aha, after restarting IntelliJ things are back to not recognizing GoogleAuthProvider again. phew!