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

3

23

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.

Jackdaw answered 10/10, 2011 at 11:24 Comment(3)
Did you ever find a solution? Please follow up and post it if you found something better than ack.Omnibus
@kobejohn No better solution.Jackdaw
No, I use vim+haskellmode+hoogle.Jackdaw
C
2

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.

Chitchat answered 8/7, 2012 at 13:15 Comment(0)
B
1

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.

Brendonbrenk answered 25/1, 2013 at 14:6 Comment(0)
O
0

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

Omnibus answered 21/5, 2012 at 14:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.