Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 207
gremdrus Avatar asked Oct 30 '22 03:10

gremdrus


1 Answers

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.

like image 92
mgsloan Avatar answered Nov 15 '22 10:11

mgsloan