rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.32k stars 94 forks source link

Not able to navigate to third party function definitions #97

Closed chrissound closed 7 years ago

chrissound commented 7 years ago

I can't seem to navigate to third party function definitions, I get a "No usages found in All places" popup when attempting to navigate to the definition.

It seems the sources have not been downloaded:

ideaHaskellLib
└── ghc-prim-0.5.0.0
    ├── cbits
    │   ├── atomic.c
    │   ├── bswap.c
    │   ├── clz.c
    │   ├── ctz.c
    │   ├── debug.c
    │   ├── longlong.c
    │   ├── popcnt.c
    │   └── word2float.c
    ├── changelog.md
    ├── GHC
    │   ├── Classes.hs
    │   ├── CString.hs
    │   ├── Debug.hs
    │   ├── IntWord64.hs
    │   ├── Magic.hs
    │   ├── Prim.hs
    │   ├── PrimopWrappers.hs
    │   ├── Tuple.hs
    │   └── Types.hs
    ├── ghc-prim.cabal
    ├── LICENSE
    └── Setup.hs

While my .cabal file has some dependencies:

name:                mybeT
version:             0.1.0.0
build-type:          Simple
cabal-version:       >=1.10

executable mybeT
  main-is:             Main.hs
  build-depends:       base >=4.9 && <4.10
                       ,snap
                       ,snap-core
                       ,lens
                       ,snap-server
  default-language:    Haskell2010

I am using the community edition if it makes any difference.

The event log (when starting up intelilj):

12/27/16
4:58 PM Info while executing `/usr/bin/stack build intero`:  /usr/bin/stack build intero

4:58 PM build of Intero is finished

4:58 PM Build of build of dependencies is starting with command `stack build --test --only-dependencies --haddock --fast`

4:58 PM Info while executing `/usr/bin/stack build --test --only-dependencies --haddock --fast`:  /usr/bin/stack build --test --only-dependencies --haddock --fast

4:58 PM [project-stack-repl] Stack repl is not yet available. Command was: :load /home/archie/projects/hbook/mybeT/Main.hs

4:58 PM build of dependencies is finished

4:58 PM [project-stack-repl] Stack repl will be started with command: /usr/bin/stack repl --with-ghc intero --verbosity warn --no-build --terminal --no-load --test

4:58 PM [project-stack-repl] Package module `Paths_mybeT` will be loaded

4:58 PM [project-stack-repl] Stack repl is started.

4:58 PM [global-stack-repl] Stack repl will be started with command: /usr/bin/stack repl --with-ghc intero --verbosity warn --no-build --terminal --no-load --no-package-hiding

4:58 PM [global-stack-repl] Stack repl is started.

4:58 PM Start to preload cache

4:58 PM Timeout while executing `/usr/bin/stack exec -- hlint --json /home/archie/projects/hbook/mybeT/Main.hs`

4:59 PM Timeout while executing `/usr/bin/stack exec -- hoogle --numeric-version`

4:59 PM Could not determine version of (maybe already installed) Hoogle. Version 5 of Hoogle will not be automatically build

4:59 PM Build of Build of `haskell-docs` and `hlint` is starting with command `stack build haskell-docs hlint`

4:59 PM Info while executing `/usr/bin/stack build haskell-docs hlint`:  /usr/bin/stack build haskell-docs hlint

4:59 PM [project-stack-repl] No result from Stack repl within 5 seconds. Command was: :load /home/archie/projects/hbook/mybeT/Main.hs

4:59 PM [project-stack-repl] command: :load

4:59 PM [project-stack-repl] stdOut: Prelude> Prelude> ^IntellijHaskell^
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :complete repl "import " 

4:59 PM [project-stack-repl] stdOut: ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [global-stack-repl] command: :show language

4:59 PM [global-stack-repl] stdOut: base language is: Haskell2010
                with the following modifiers:
                -XNoDatatypeContexts
                -XNondecreasingIndentation
                ^IntellijHaskell^

4:59 PM [global-stack-repl] errOut: 

4:59 PM Finished with preloading cache

4:59 PM Restarting global repl to release memory

4:59 PM [global-stack-repl] Stack repl is stopped.

4:59 PM [global-stack-repl] Stack repl will be started with command: /usr/bin/stack repl --with-ghc intero --verbosity warn --no-build --terminal --no-load --no-package-hiding

4:59 PM [global-stack-repl] Leaving GHCi.

4:59 PM [global-stack-repl] Stack repl is started.

4:59 PM Build of `haskell-docs` and `hlint` is finished

4:59 PM [project-stack-repl] command: :load /home/archie/projects/hbook/mybeT/Main.hs

4:59 PM [project-stack-repl] stdOut: Ok, modules loaded: Main.
                Collecting type info for 1 module(s) ... 
                ^IntellijHaskell^
                Ok, modules loaded: none.
                ^IntellijHaskell^
                309 309 "import "
                "Control.Applicative"
                "Control.Arrow"
                "Control.Category"
                "Control.Concurrent"
                "Control.Concurrent.Chan"
                "Control.Concurrent.MVar"
                "Control.Concurrent.QSem"
                "Control.Concurrent.QSemN"
                "Control.Exception"
                "Control.Exception.Base"
                "Control.Exception.Lens"
                "Control.Lens"
                "Control.Lens.At"
                "Control.Lens.Combinators"
                "Control.Lens.Cons"
                "Control.Lens.Each"
                "Control.Lens.Empty"
                "Control.Lens.Equality"
                "Control.Lens.Extras"
                "Control.Lens.Fold"
                "Control.Lens.Getter"
                "Control.Lens.Indexed"
                "Control.Lens.Internal"
                "Control.Lens.Internal.Bazaar"
                "Control.Lens.Internal.ByteString"
                "Control.Lens.Internal.Coerce"
                "Control.Lens.Internal.Context"
                "Control.Lens.Internal.Deque"
                "Control.Lens.Internal.Exception"
                "Control.Lens.Internal.FieldTH"
                "Control.Lens.Internal.Fold"
                "Control.Lens.Internal.Getter"
                "Control.Lens.Internal.Indexe... (show balloon)

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] No result from Stack repl within 2 seconds. Command was: :info App

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 16 24 16 26 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :info App

4:59 PM [project-stack-repl] stdOut: data App = App {_heist :: Snaplet (Heist App)}
                -- Defined at /home/archie/projects/hbook/mybeT/Main.hs:10:1
                instance HasHeist App
                -- Defined at /home/archie/projects/hbook/mybeT/Main.hs:13:10
                ^IntellijHaskell^
                /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] No result from Stack repl within 2 seconds. Command was: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 10 6 10 8 App

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 10 12 10 14 App

4:59 PM [project-stack-repl] stdOut: data App = App {_heist :: Snaplet (Heist App)}
                -- Defined at /home/archie/projects/hbook/mybeT/Main.hs:10:1
                instance HasHeist App
                -- Defined at /home/archie/projects/hbook/mybeT/Main.hs:13:10
                ^IntellijHaskell^
                /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 10 43 10 45 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 11 14 11 16 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 13 19 13 21 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 14 27 14 29 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 14 31 14 33 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 16 20 16 22 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 23 14 23 16 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :type-at /home/archie/projects/hbook/mybeT/Main.hs 11 14 11 17 App

4:59 PM [project-stack-repl] stdOut: App
                :: p (Snaplet (Heist App)) (f (Snaplet (Heist App)))
                -> p App (f App)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :type-at /home/archie/projects/hbook/mybeT/Main.hs 23 14 23 17 App

4:59 PM [project-stack-repl] stdOut: App :: Snaplet (Heist App) -> App
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

4:59 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 10 6 10 8 App

4:59 PM [project-stack-repl] stdOut: /home/archie/projects/hbook/mybeT/Main.hs:(10,1)-(10,49)
                ^IntellijHaskell^

4:59 PM [project-stack-repl] errOut: 

5:00 PM [project-stack-repl] command: :load /home/archie/projects/hbook/mybeT/Main.hs

5:00 PM [project-stack-repl] stdOut: [1 of 1] Compiling Main             ( /home/archie/projects/hbook/mybeT/Main.hs, interpreted )
                Ok, modules loaded: Main.
                Collecting type info for 1 module(s) ... 
                ^IntellijHaskell^

5:00 PM [project-stack-repl] errOut: 

5:00 PM Error while executing` /usr/bin/stack hoogle --rebuild`:  Rebuilding database ...
                mybeT-0.1.0.0: configure (exe)
                Configuring mybeT-0.1.0.0...
                mybeT-0.1.0.0: build (exe)
                Preprocessing executable 'mybeT' for mybeT-0.1.0.0...
                [1 of 1] Compiling Main             ( Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/mybeT/mybeT-tmp/Main.o )
                Linking .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/mybeT/mybeT ...
                mybeT-0.1.0.0: copy/register
                Installing executable(s) in
                /home/archie/projects/hbook/mybeT/.stack-work/install/x86_64-linux/lts-7.14/8.0.1/bin
                Built docs.
                Generated DB.

5:01 PM [project-stack-repl] command: :type-at /home/archie/projects/hbook/mybeT/Main.hs 37 3 37 9 render

5:01 PM [project-stack-repl] stdOut: render ::
                HasHeist b =>
                bytestring-0.10.8.1:Data.ByteString.Internal.ByteString
                -> Handler b v ()
                ^IntellijHaskell^

5:01 PM [project-stack-repl] errOut: 

5:01 PM [project-stack-repl] command: :loc-at /home/archie/projects/hbook/mybeT/Main.hs 37 3 37 8 render

5:01 PM [project-stack-repl] stdOut: snap-1.0.0.1-G2752lRMid6Ah1ugBruaUh:Snap.Snaplet.Heist
                ^IntellijHaskell^

5:01 PM [project-stack-repl] errOut: 

5:01 PM [project-stack-repl] command: :info render

5:01 PM [project-stack-repl] stdOut: render ::
                HasHeist b =>
                bytestring-0.10.8.1:Data.ByteString.Internal.ByteString
                -> Handler b v ()
                -- Defined in ‘Snap.Snaplet.Heist’
                ^IntellijHaskell^

5:01 PM [project-stack-repl] errOut: 
rikvdkleij commented 7 years ago

Event log is okay It looks like source code of dependencies is not downloaded Can you see libraries in Project structure? You can download them manually from menu Tools option

chrissound commented 7 years ago

Hmm there is no entries in the libraries, do I just add the folder where stack saves the sources?

rikvdkleij commented 7 years ago

You can use option in Tools menu to download them

On Dec 27, 2016 6:10 PM, "Chris Stryczynski" notifications@github.com wrote:

Hmm there is no entries in the libraries, do I just add the folder where stack saves the sources?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rikvdkleij/intellij-haskell/issues/97#issuecomment-269353855, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfFg9PdZZQI7fIobVZOv93xtRPNEXyBks5rMUZmgaJpZM4LWZCB .

zjhmale commented 7 years ago

HI @chrissound, the download option which @rikvdkleij mentioned can be found here

chrissound commented 7 years ago

Yes! It worked! Had to restart intellij after I did the above.

Thank you! This is amazing!

rikvdkleij commented 7 years ago

@chrissound I do not understand why you had to restart IntelliJ (maybe something else was also not initialised) but I'm glad it works!

@zjhmale Thanks for the screenshot!