haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 211 forks source link

I'm addicted! - Now I'm stuck and need advice on how to troubleshoot #1769

Closed EdmundsEcho closed 4 years ago

EdmundsEcho commented 4 years ago

First and foremost

I love, absolutely love what you all have accomplished with HIE. I have been using Haskell for ~5 years with Neovim. As much as I appreciated the prior efforts and plugins, using HIE has been a game changer. I use <shift> K all the time to get my nicely documented types and function definitions. Great stuff. Thank you!! (It has also been great to have neovim with the "pop-up" window and the language server capacity to display the defs; so kudos all-round).

Issue

And, yesterday the functionality through using Coc stopped working. At one point Coc reported not having a "definition provider".

vim version: NVIM v0.4.3 node version: v13.2.0 coc.nvim version: 0.0.78-fd9e7d3972 term: iTerm.app platform: darwin

Output channel: prettier


### Status and request for input
I'm at a loss on how to troubleshoot from here.  e.g., how might I ascertain that the HIE server is up and running? I had at least 2-3 instances of neovim working on haskell code for over a month.  Perhaps one of the updates requires that I "restart" the server.  Quitting those instances and restarting neovim did not work.  

Thank you in advance of any guidance.

### More context that might be helpful (these were not changed)
My `CocConfig` entry for haskell:

```json
    "haskell": {
      "command": "hie-wrapper",
      "args": ["--lsp", "--debug"],
      "rootPatterns": [
        ".stack.yaml",
        "cabal.config",
        "package.yaml"
      ],
      "filetypes": [
        "hs",
        "lhs",
        "haskell"
      ],
      "initializationOptions": {
        "languageServerHaskell": {
          "hlintOn": true,
          "hsimport": true,
          "maxNumberOfProblems": 20,
          "completionsSnippetsOn": true
        }
      }
    }

My hie.yaml entry

cradle:
  stack:
    - path: "./app/Main.hs"
      component: "obs:exe:obs-exe"

    - path: "./src"
      component: "obs:lib"

    - path: "./tests/Spec.hs"
      component: "obs:test:obs-test"
EdmundsEcho commented 4 years ago

Solution found, and

I ran PlugUpdate again this morning (inspired by drafting this issue); coc.nvim had an update with multiple changes... The information from HIE is now making it's way to Neovim. Problem solved... however,

Answer for how to confirm an operating language server

The signature in the list of active processes is really clear: hie-version and hie-wrapper.

So between running hie-wrapper within the project folder manually in the terminal to confirm the parsing of the application code, tracking the dynamics from CocInfo, AND watching the process come and go by starting and quitting nvim, I suspect I would have identified there is a problem with coc.

Final notes regarding coc's capacity to determine the version of hie and the starting and stopping of the `hie-related processes

Note: I'm not commenting on the design, but just taking inventory.

... on a related note, I routinely have to restart coc following an edit to get HIE to generate the feed. I have not isolated the types of updates that somehow jam hie or coc's capacity to server.

- E