rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

jumping to wrong definition? #524

Closed aryairani closed 4 years ago

aryairani commented 4 years ago

With beta63

  1. Using:
    $ git clone --recursive https://github.com/unisonweb/unison && \
        git -C unison checkout --recurse-submodules b5cae909
  2. I create a new intellij-haskell project for unison/, and open FileCodebase.hs:345 image
  3. I put the cursor on Branch.sync and then Navigate -> Goto (Cmd+B)
  4. I want it to open Branch.hs:477, but it opens Causal.hs:134 by mistake.

It seems like a regression to be honest, unless something else has changed.

Thanks in advance :)

aryairani commented 4 years ago
$ stack --version
Version 2.1.3 x86_64
rikvdkleij commented 4 years ago

Thanks for reporting! I will take a look soon.

aryairani commented 4 years ago

I just noticed a simpler example โ€”ย even within Branch.hs, from a reference Raw (defined in this same file), it jumps to the Raw in Causal.hs.

rikvdkleij commented 4 years ago

It's a bug in ghci:

21:14   [project-stack-repl-unison-parser-typechecker:lib] Command :loc-at /home/rik/projects/unison/parser-typechecker/src/Unison/Codebase/Branch.hs 202 12 202 14 Raw took + 3 ms

21:14   [project-stack-repl-unison-parser-typechecker:lib] stdout: /home/rik/projects/unison/parser-typechecker/src/Unison/Codebase/Causal.hs:(97,1)-(100,33)
rikvdkleij commented 4 years ago

About your first case:

aryairani commented 4 years ago

Yeah. When it's on sync and ctrl-b and it doesn't work, sometimes I go back, try again on Branch, it takes me to the qualified, then I go to the module name, and ctrl-b again to open Branch.hs, and then search for sync :(

rikvdkleij commented 4 years ago

Ok, at least the issue with Raw is explained.

rikvdkleij commented 4 years ago

@aryairani Can you check beta64?

aryairani commented 4 years ago

@rikvdkleij I didn't do a fully clean install like when I opened the ticket (please advise), but it looks like the same issue in the initial message occurs for me in beta64.

rikvdkleij commented 4 years ago

@aryairani I couldn't reproduce the issue with sync on master so that's why I asked you to check it. Maybe it helps to invalidate the IntelliJ cache.

aryairani commented 4 years ago

"Invalidate + Restart" didn't help me, but I'm trying now with a new project (waiting for it to build).

rikvdkleij commented 4 years ago

@aryairani O sorry, I can reproduce your issue with Branch.sync I will take a look.

aryairani commented 4 years ago

Ok great ๐Ÿ˜…

rikvdkleij commented 4 years ago

I have found solutions for both cases, so also for the ghci bug, but need some to test those. Also found other cases which can be improved.

aryairani commented 4 years ago

๐Ÿป

aryairani commented 4 years ago

Not sure if this is the same or different, but I have been bumping into this:

$ git clone --recursive https://github.com/unisonweb/unison && \
    git -C unison checkout --recurse-submodules 9b30c712

from UnisonFile.hs:160:70 I try to jump to Term.dependencies, but am jumped to DataDeclaration.dependencies instead. ๐Ÿ˜ž

rikvdkleij commented 4 years ago

Thanks! That's another case...

aryairani commented 4 years ago

Should I create a separate ticket for this, or is it okay to keep adding them here?

rikvdkleij commented 4 years ago

A separate ticket is not needed.

rikvdkleij commented 4 years ago

Should be fixed in beta65

rikvdkleij commented 4 years ago

@aryairani Can this one be closed?

rikvdkleij commented 4 years ago

Please reopen if still an issue.