Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Implement Goto Type Definition #533

Merged
merged 8 commits into from
Jun 9, 2020

Conversation

mpickering
Copy link
Contributor

The test fails for some reason locally but works in the editor so if someone knows how to fix it then please tell me.

@mpickering mpickering force-pushed the goto-type-definition branch 2 times, most recently from d715de7 to 9f59e80 Compare April 22, 2020 20:03
@cocreature
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you! HLint is currently failing due to a redundant $ and the indentation in nameToLocation seems off. Sadly Azure seems to have deleted the old CI logs. I’ll take a look at the test failures once we get past the hlint failures.

-- | Given a 'Name' attempt to find the location where it is defined.
nameToLocation :: Monad f => (Module -> f (Maybe (HieFile, String))) -> Name -> f (Maybe SrcSpan)
nameToLocation getHieFile name =
case nameSrcSpan name of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation here seems a bit excessive.

test/exe/Main.hs Outdated Show resolved Hide resolved
@cocreature
Copy link
Collaborator

This has a merge conflict in AtPoint.hs.

@mpickering
Copy link
Contributor Author

I have no idea how the tests work at the moment as they don't even typecheck? I fixed that and then see this log:

HIE
  get
    type-definition
      Saturated data con:   ghcide version: 0.1.0 (GHC: 8.8.3) (PATH: /home/matt/ghcide-clean/dist-newstyle/build/x86_64-linux/ghc-8.8.3/ghcide-0.1.0/x/ghcide/build/ghcide/ghcide) (GIT hash: e231f7a0bc5f52bc3de1c5d4659274b7ba57d6d5)
Starting LSP server...
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 Started LSP server in 0.00s
[DEBUG] Set files of interest to: [NormalizedFilePath "/run/user/1000/extra-dir-58388217296644/GotoHover.hs"]
[DEBUG] Starting shakeRun (aborting the previous one took 0.00s)
[INFO] Opened text document: file:///run/user/1000/extra-dir-58388217296644/GotoHover.hs
[INFO] Files created or deleted: [(NormalizedFilePath "/run/user/1000/extra-dir-58388217296644/GotoHover.hs",True)]
[DEBUG] Starting shakeRun (aborting the previous one took 0.00s)
[DEBUG] Finishing shakeRun (took 0.00s, exception: AsyncCancelled)
[INFO] TypeDefinition request at position 19:21 in file: /run/user/1000/extra-dir-58388217296644/GotoHover.hs
[DEBUG] Finishing shakeRun (took 0.00s, exception: AsyncCancelled)
[DEBUG] Starting shakeRun (aborting the previous one took 0.00s)
[DEBUG] Running cradle /run/user/1000/extra-dir-58388217296644
"success"
"success"
"success"
[DEBUG] Finishing shakeRun (took 0.14s, completed)

But the server never sends a response to the TypeDefinition request.

At this point, I am not going to look into it further as it seems like a deep rabbit hole not really concerned with this patch.

@mpickering
Copy link
Contributor Author

I have fixed the tests and identified two bugs in lsp-test in the process..

@mpickering
Copy link
Contributor Author

CI is green now, this is ready to merge.

Copy link
Collaborator

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cocreature cocreature merged commit 08e87ad into haskell:master Jun 9, 2020
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants