gremdrus
gremdrus

Reputation: 53

intero-goto-definition doesn't include libraries?

I am trying to use M-. to go to the definition of a function, but it seems like intero-goto-definition only works the library I am currently developing, not on ones that I am importing.

Here is my stack.yaml:

flags: {}
extra-package-dbs: []
packages:
- location: libs/not-gloss/not-gloss # the library I am trying to C-. into
- .
extra-deps:
- spatial-math-0.4.0.0
resolver: lts-9.0

Upvotes: 5

Views: 275

Answers (1)

mgsloan
mgsloan

Reputation: 3295

It'd be great to have this, but it's not implemented yet - https://github.com/commercialhaskell/intero/issues/231 . It would take quite a bit of effort:

1) Need to keep the source files around for all dependencies. Not sure how to make this handle wired in packages like base. These files should be marked read-only so that you aren't given the impression that you can edit them.

2) Somehow have an index that maps from module name + identifier name to source location. Haddock may have this info, not sure, but in that case, it means that you need to build all your dependencies with documentation. Alternatively, you'd need to have an extra step which reloads every package with intero, to generate an index like this. This would certainly be necessary if you wanted features like type info within the package you're viewing.

Upvotes: 2

Related Questions