How to 'go to definition' for user defined function in Leksah?

722 Views Asked by At

I can do this for system functions like const by selecting it, right clicking and choosing search(metadata). The same does not work for user defined functions.

How do you do such a search?

If it is impossible for user defined functions, how do you read an already existing Haskell project and jump between definitions and invocations?

Vim + ctags work for user defined functions only, and are not as powerful as cscope for c/c++ source.

3

There are 3 best solutions below

0
On

This solution may be totally off base because I don't use Haskell, but would ack-grep work for you? I have found it very useful for doing code dives.

I see in the documentation that it supports haskell.

I believe you would use: ack --haskell user_function

0
On

You need to use 'Update Workspace data' under the 'Configuration' menu -- Leksah doesn't index user-created functions until you do this (or restart the compiler). The default shortcut under Windows is Ctrl+M.

0
On

I tried what you said with user-defined functions and it works fine for me. I select name of function, right click, search(metadata) and it appears in the search tab to the right. Then i click "go to definition" and it takes me to definition. Maybe you should try restarting Leksah? I noticed that sometimes it doesn't recognize functions immediately as I write them, but if you restart it, it will recognize them.