On 11/13/2017 04:49 AM, Jason Harrer wrote:
> I don't think this is really the appropriate place for such a question. 
> First of all, you're using an IDE I've never even heard of before, and
> second of all, the question is not related to Snowdrift code.
> 

I don't fully agree, Jason. This is a fine place. There's nothing wrong
with using a different IDE per se (and we can say that we recommend
something else). And it's relevant tangentially.

This makes *more* sense on a general Haskell list, that is certain. So,
I'd say more like "this question makes more sense at X" (other Haskell
place) rather than say that it isn't appropriate here. Just don't want
to turn people away.

> 
> On Mon, Nov 13, 2017 at 12:30 AM, jake <jakel...@zoho.com
> <mailto:jakel...@zoho.com>> wrote:
> 
>     __
>     In Haskell code, I'd like the ability to click an identifier and go
>     to its definition. How do I do this?
> 
>     I would like to know what your methods are, since mine aren't
>     working too well.
>     This issue
>     <https://github.com/rikvdkleij/intellij-haskell/issues/237> may
>     explain some of my problems, but I'd like to hear your solutions.
> 
> 
>     If you're interested, here's what I've tried:
> 
> 
>     Recently, I have installed IntelliJ and its Haskell plugin: the
>     above being my primary motivation -- supposedly, this IDE/plugin
>     combo has the feature.
>     Problem: only rarely does it work.
> 
>     More specifically, I have only seen it work within a single file:
>     if /foo/ is defined in /bar.hs/, and I select /foo/ in /bar.hs/
>     somewhere, the option to go to its declaration (in that same file)
>     does work.
>     But I have not gotten the feature to reach much farther, which I am
>     in need of far more often.
> 
>     For example, say there's 20 import statements. I would hope that
>     there is a much more efficient way of finding where something is
>     imported from than Googling each module individually.
> 
> 
>     To give my actual case:
> 
>     I was perusing sdb.hs and saw:
> 
>         -- | Seeing as I use this everywhere
>         toText_ :: FilePath -> Text
>         toText_ = format fp
> 
>     And I though to myself, "Hmm. I wonder where fp is defined? And
>     format?" So I use the "Go to Declaration" feature.
> 
>     But even if I tell IntelliJ to search "All Places", it says "No
>     Usages Found in All Places".
>     Aside: If you take a moment to think about that, it doesn't make
>     sense. I did /not/ ask it to find usages, I asked it to find a
>     declaration. Which is kind of the opposite.
> 
>     Hitting "Ctrl + Shift + H" (Built-in Hoogle) did reveal that fp is
>     in SPARC.Regs, but I have no way of knowing if this is the same fp
>     as the one used in sdb.hs. Further, SPARC is not listed in my
>     External Libraries, so this would suggest that it is not the same fp.
>     Hoogle on the web could not find any fp at all. And neither variety
>     of Hoogle could find format, at least not the one used in sdb.hs.
> 
>     Anyhow, I find out about GHCI's " :info " command. So I run "stack
>     ghci", and from within there, I try to load sdb.hs, with the hope of
>     using the info command on the two aforementioned identifiers. But
>     that fails, because it could not find several modules, claiming them
>     to be members of hidden packages.
> 
>     I even "grep -R"  ~/.intellij-haskell/lib/snowdrift, and that
>     couldn't find them, either.
> 
> 
> 
>     The above is more or less an arbitrarily chosen example. Really, you
>     can pick just about any Haskell code file (.hs), pick any of a
>     number of identifiers it contains, and you'll see this problem,
>     provided the identifier was declared in a module external to Snowdrift.
> 
> 
>     So how do I get to the definitions of things? I find this absolutely
>     vital. The compiler is able to get to them ... therefore I should be
>     able, too.
> 
> 
>     Cheers,
>     Jake
> 

Jake, none of us have used IntelliJ, so I can't speak to that
specifically. But we do have jump-to-definition working in other places
(Atom, Vim, Emacs…)

The file TEXTEDITORS.md in the main code describes suggested setups that
we know work. In that file, there's a section about Hasktags and jumping
to definitions.

So, if IntelliJ supports tags, then Hasktags should work there the same
as it does with the other editors we are familiar with.

Cheers,
Aaron

P.S. If you get a fully working IntelliJ setup, feel free to add a
section to our TEXTEDITORS.md file.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Dev mailing list
Dev@lists.snowdrift.coop
https://lists.snowdrift.coop/mailman/listinfo/dev

Reply via email to