commercialhaskell / stack-ide

Stack-based JSON interface to ide-backend
98 stars 23 forks source link

Tracking cabal executables #28

Closed lukexi closed 8 years ago

lukexi commented 9 years ago

I noticed that stack-ide doesn't seem to track files in executable targets (i.e. when I run stack ide myproject it only compiles/reports errors for the "library" section of the cabal file). Is there a way to do this?

(including test-suites would be great too)

mgsloan commented 9 years ago

I believe this has the same root cause as https://github.com/commercialhaskell/stack/issues/347

While this isn't mentioned there, one thing to try might be to add an other-modules list for the executable. Not sure if that'll fix it, but cabal does support this field for executables / test-suites, though it doesn't demand it.

drwebb commented 9 years ago

I have the same issue when writing tests (really sucks for TDD). I'm on emacs and stack-mode properly load my tests module either when I run stack-load-buffer.

Since https://github.com/commercialhaskell/stack/pull/753 I've been able to run stack ghci <packagename>:exec:<executable compenent>. Could the new way stack ghci finds dependencies be added some way to stack-ide?

bixuanzju commented 9 years ago

For the moment, I am adding an other-modules list for the executable to workaround this, works for me.

chrisdone commented 9 years ago

I added support for this in stack ghci. I'll add it to stack-ide soon.

rvion commented 9 years ago

as usual, big thanks !

carymrobbins commented 9 years ago

So does stack-ide only support library components currently?

chrisdone commented 9 years ago

No, it just needs a way in its UI to disambiguate Main modules between components.

chrisdone commented 9 years ago

https://github.com/commercialhaskell/stack-ide/issues/63

chrisdone commented 8 years ago

Closing as dupe of #63 which describes the point accurately.