purescript-emacs / psc-ide-emacs

Emacs integration for PureScript's psc-ide tool.
GNU General Public License v3.0
131 stars 31 forks source link

goto-def doesn't work with spago/bower dual build #172

Open reactormonk opened 5 years ago

reactormonk commented 5 years ago

I have a project which has both bower and spago build - rave, and goto-def doesn't work there. It doesn't find rather straightfoward (e.g. Mu) constructors where I don't have any issues in other projects.

kritzcreek commented 5 years ago

The plugin detects the project type in the order psc-package -> bower -> spago

https://github.com/purescript-emacs/psc-ide-emacs/blob/b2c833d355e17a6ba5532db550da9ff9e0c4325e/psc-ide.el#L252-L254

So if you've got a bower.json it will use globs for a bower project by default. I'm assuming you've installed your dependencies with spago though? What's the behaviour we should be going for here? Just appending globs for both bower and spago will lead to problems if you've installed dependencies with both.

reactormonk commented 5 years ago

Maybe make it explicit in the message

Detected multiple project files: bower.json, spago.dhall

which one will be picked. Yeah, I installed deps via spago mostly.

However, even if I run bower install, it can't find the definition of SProxy. Works just fine in my bower-only project.

kritzcreek commented 5 years ago

I think for now we could just change the order in which it checks things and assume that if people have a spago.dhall file they want to use that for their local development, and just have the bower.json there for publishing purposes. (So flip around the ordering of cases to 1 spago 2 psc-package 3 bower)