Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with symbolic links #133

Open
MartinGas opened this issue Sep 20, 2021 · 8 comments
Open

Trouble with symbolic links #133

MartinGas opened this issue Sep 20, 2021 · 8 comments

Comments

@MartinGas
Copy link

When accessing a buffer via a symbolic link I got an error: Multi Cradle: No prefixes matched. It's a brand new project set up via with stack new, I only changed the resolver version to 8.10.4 and removed Setup.hs . When accessing the same buffer by its proper path everything seems to work. I don't get any errors from haskell-language-server nor from hie-bios executed on the terminal. I saved the output of gen-hie to hie.yaml in the project's root. I'm on versions 8.10.4 for haskell-language-server, 0.5.1 for hie-bios and a recent install of gen-hie. What's wrong here?

Here's the log of a session with error:

[Trace - 04:28:33 ] Sending request 'initialize - (1)'.
Params: {
  "processId": null,
  "rootPath": "/home/martin/Schreibtisch/lnthesis/code/generator",
  "clientInfo": {
    "name": "emacs",
    "version": "GNU Emacs 27.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4)\n of 2021-08-07"
  },
  "rootUri": "file:///home/martin/Schreibtisch/lnthesis/code/generator",
  "capabilities": {
    "workspace": {
      "workspaceEdit": {
        "documentChanges": true,
        "resourceOperations": [
          "create",
          "rename",
          "delete"
        ]
      },
      "applyEdit": true,
      "symbol": {
        "symbolKind": {
          "valueSet": [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26
          ]
        }
      },
      "executeCommand": {
        "dynamicRegistration": false
      },
      "didChangeWatchedFiles": {
        "dynamicRegistration": true
      },
      "workspaceFolders": true,
      "configuration": true,
      "fileOperations": {
        "didCreate": false,
        "willCreate": false,
        "didRename": false,
        "willRename": false,
        "didDelete": false,
        "willDelete": false
      }
    },
    "textDocument": {
      "declaration": {
        "linkSupport": true
      },
      "definition": {
        "linkSupport": true
      },
      "implementation": {
        "linkSupport": true
      },
      "typeDefinition": {
        "linkSupport": true
      },
      "synchronization": {
        "willSave": true,
        "didSave": true,
        "willSaveWaitUntil": true
      },
      "documentSymbol": {
        "symbolKind": {
          "valueSet": [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26
          ]
        },
        "hierarchicalDocumentSymbolSupport": true
      },
      "formatting": {
        "dynamicRegistration": true
      },
      "rangeFormatting": {
        "dynamicRegistration": true
      },
      "rename": {
        "dynamicRegistration": true,
        "prepareSupport": true
      },
      "codeAction": {
        "dynamicRegistration": true,
        "isPreferredSupport": true,
        "codeActionLiteralSupport": {
          "codeActionKind": {
            "valueSet": [
              "",
              "quickfix",
              "refactor",
              "refactor.extract",
              "refactor.inline",
              "refactor.rewrite",
              "source",
              "source.organizeImports"
            ]
          }
        },
        "resolveSupport": {
          "properties": [
            "edit",
            "command"
          ]
        },
        "dataSupport": true
      },
      "completion": {
        "completionItem": {
          "snippetSupport": true,
          "documentationFormat": [
            "markdown",
            "plaintext"
          ],
          "resolveAdditionalTextEditsSupport": true,
          "insertReplaceSupport": true,
          "resolveSupport": {
            "properties": [
              "documentation",
              "details",
              "additionalTextEdits",
              "command"
            ]
          },
          "insertTextModeSupport": {
            "valueSet": [
              1,
              2
            ]
          }
        },
        "contextSupport": true
      },
      "signatureHelp": {
        "signatureInformation": {
          "parameterInformation": {
            "labelOffsetSupport": true
          }
        }
      },
      "documentLink": {
        "dynamicRegistration": true,
        "tooltipSupport": true
      },
      "hover": {
        "contentFormat": [
          "markdown",
          "plaintext"
        ]
      },
      "foldingRange": {
        "dynamicRegistration": true
      },
      "callHierarchy": {
        "dynamicRegistration": false
      },
      "publishDiagnostics": {
        "relatedInformation": true,
        "tagSupport": {
          "valueSet": [
            1,
            2
          ]
        },
        "versionSupport": true
      },
      "moniker": null,
      "linkedEditingRange": null
    },
    "window": {
      "workDoneProgress": true,
      "showMessage": null,
      "showDocument": null
    }
  },
  "initializationOptions": null,
  "workDoneToken": "1"
}


[Trace - 04:28:33 ] Received response 'initialize - (1)' in 272ms.
Result: {
  "capabilities": {
    "codeActionProvider": true,
    "workspaceSymbolProvider": true,
    "textDocumentSync": {
      "openClose": true,
      "change": 2,
      "save": {
      }
    },
    "documentSymbolProvider": true,
    "codeLensProvider": {
      "workDoneProgress": null,
      "resolveProvider": null
    },
    "selectionRangeProvider": null,
    "referencesProvider": true,
    "documentFormattingProvider": true,
    "definitionProvider": true,
    "workspace": {
      "workspaceFolders": {
        "changeNotifications": true,
        "supported": true
      }
    },
    "completionProvider": {
      "triggerCharacters": [
        "."
      ],
      "resolveProvider": null
    },
    "implementationProvider": null,
    "documentHighlightProvider": true,
    "documentRangeFormattingProvider": true,
    "executeCommandProvider": {
      "commands": [
        "34001:tactics:tacticsAutoCommand",
        "34001:tactics:tacticsIntrosCommand",
        "34001:tactics:tacticsDestructCommand",
        "34001:tactics:tacticsHomomorphismCommand",
        "34001:tactics:tacticsDestructLambdaCaseCommand",
        "34001:tactics:tacticsHomomorphismLambdaCaseCommand",
        "34001:tactics:tacticsDestructAllCommand",
        "34001:tactics:tacticsUseDataConCommand",
        "34001:tactics:tacticsRefineCommand",
        "34001:retrie:retrieCommand",
        "34001:class:addMinimalMethodPlaceholders",
        "34001:eval:evalCommand",
        "34001:importLens:ImportLensCommand",
        "34001:moduleName:edit",
        "34001:hlint:applyOne",
        "34001:hlint:applyAll",
        "34001:splice:expandTHSpliceInplace",
        "34001:ghcide-completions:extendImport",
        "34001:ghcide-type-lenses:typesignature.add"
      ]
    },
    "declarationProvider": null,
    "renameProvider": null,
    "colorProvider": null,
    "typeDefinitionProvider": true,
    "hoverProvider": true,
    "foldingRangeProvider": null
  }
}


[Trace - 04:28:33 ] Sending notification 'initialized'.
Params: {
}


[Trace - 04:28:33 ] Sending notification 'workspace/didChangeConfiguration'.
Params: {
  "settings": {
    "haskell": {
      "plugin": {
        "hlint": {
          "globalOn": true
        },
        "moduleName": {
          "globalOn": true
        },
        "refineImports": {
          "globalOn": true
        },
        "importLens": {
          "globalOn": true
        },
        "eval": {
          "globalOn": true
        },
        "retrie": {
          "globalOn": true
        },
        "tactic": {
          "globalOn": true
        },
        "brittany": {
          "globalOn": true
        },
        "stylish-haskell": {
          "globalOn": true
        },
        "ormolu": {
          "globalOn": true
        },
        "fourmolu": {
          "globalOn": true
        },
        "floskell": {
          "globalOn": true
        },
        "pragmas": {
          "globalOn": true
        },
        "ghcide": {
          "globalOn": true
        }
      },
      "hlintOn": true,
      "maxNumberOfProblems": 100,
      "diagnosticsOnChange": true,
      "liquidOn": false,
      "completionSnippetsOn": true,
      "formatOnImportOn": true,
      "formattingProvider": "ormolu"
    }
  }
}


[Trace - 04:28:33 ] Sending notification 'textDocument/didOpen'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs",
    "languageId": "haskell",
    "version": 0,
    "text": "module Main where\n\nimport Lib\n\nmain :: IO ()\nmain = someFunc\n"
  }
}


[Trace - 04:28:33 ] Sending request 'textDocument/documentSymbol - (2)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  }
}


[Trace - 04:28:33 ] Sending request 'textDocument/codeAction - (3)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:28:33 ] Sending request 'textDocument/documentHighlight - (4)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:28:33 ] Sending request 'textDocument/codeAction - (5)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:28:33 ] Received request 'client/registerCapability - (0).
Params: {
  "registrations": [
    {
      "registerOptions": {
        "watchers": [
          {
            "globPattern": "**/*.hs",
            "kind": 7
          },
          {
            "globPattern": "**/*.hs-boot",
            "kind": 7
          },
          {
            "globPattern": "**/*.lhs",
            "kind": 7
          },
          {
            "globPattern": "**/*.lhs-boot",
            "kind": 7
          }
        ]
      },
      "method": "workspace/didChangeWatchedFiles",
      "id": "globalFileWatches"
    }
  ]
}


[Trace - 04:28:33 ] Sending response 'client/registerCapability - (0)'. Processing request took 2ms
Params: {
  "jsonrpc": "2.0",
  "id": 0,
  "result": null
}


[Trace - 04:28:33 ] Received request 'window/workDoneProgress/create - (1).
Params: {
  "token": 0
}


[Trace - 04:28:33 ] Sending response 'window/workDoneProgress/create - (1)'. Processing request took 0ms
Params: {
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}


[Trace - 04:28:33 ] Received notification '$/progress'.
Params: {
  "value": {
    "cancellable": null,
    "kind": "begin",
    "title": "Setting up generator (for app/Main.hs)"
  },
  "token": 0
}


[Trace - 04:28:33 ] Received notification '$/progress'.
Params: {
  "value": {
    "kind": "end"
  },
  "token": 0
}


[Trace - 04:28:33 ] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs",
  "diagnostics": [
    {
      "source": "cradle",
      "severity": 1,
      "message": "Multi Cradle: No prefixes matched\npwd: /home/martin/Schreibtisch/lnthesis/code/generator\nfilepath: /home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs\nprefixes:\n(\"./src\",Stack {component = Just \"generator:lib\", stackYaml = Nothing})\n(\"./app/Main.hs\",Stack {component = Just \"generator:exe:generator-exe\", stackYaml = Nothing})\n(\"./app/Paths_generator.hs\",Stack {component = Just \"generator:exe:generator-exe\", stackYaml = Nothing})\n(\"./test\",Stack {component = Just \"generator:test:generator-test\", stackYaml = Nothing})\n",
      "range": {
        "start": {
          "line": 0,
          "character": 0
        },
        "end": {
          "line": 1,
          "character": 0
        }
      }
    }
  ]
}


[Trace - 04:28:33 ] Received response 'textDocument/documentSymbol - (2)' in 11ms.
Result: []


[Trace - 04:28:33 ] Received response 'textDocument/documentHighlight - (4)' in 11ms.
Result: []


[Trace - 04:28:33 ] Received response 'textDocument/codeAction - (3)' in 11ms.
Result: []


[Trace - 04:28:33 ] Received response 'textDocument/codeAction - (5)' in 10ms.
Result: []


[Trace - 04:28:33 ] Sending request 'textDocument/codeAction - (6)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": [
      {
        "source": "cradle",
        "severity": 1,
        "message": "Multi Cradle: No prefixes matched\npwd: /home/martin/Schreibtisch/lnthesis/code/generator\nfilepath: /home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs\nprefixes:\n(\"./src\",Stack {component = Just \"generator:lib\", stackYaml = Nothing})\n(\"./app/Main.hs\",Stack {component = Just \"generator:exe:generator-exe\", stackYaml = Nothing})\n(\"./app/Paths_generator.hs\",Stack {component = Just \"generator:exe:generator-exe\", stackYaml = Nothing})\n(\"./test\",Stack {component = Just \"generator:test:generator-test\", stackYaml = Nothing})\n",
        "range": {
          "start": {
            "line": 0,
            "character": 0
          },
          "end": {
            "line": 1,
            "character": 0
          }
        }
      }
    ]
  }
}


[Trace - 04:28:33 ] Received response 'textDocument/codeAction - (6)' in 28ms.
Result: []


[Trace - 04:28:58 ] Sending request 'textDocument/codeAction - (7)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": [
      {
        "source": "cradle",
        "severity": 1,
        "message": "Multi Cradle: No prefixes matched\npwd: /home/martin/Schreibtisch/lnthesis/code/generator\nfilepath: /home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs\nprefixes:\n(\"./src\",Stack {component = Just \"generator:lib\", stackYaml = Nothing})\n(\"./app/Main.hs\",Stack {component = Just \"generator:exe:generator-exe\", stackYaml = Nothing})\n(\"./app/Paths_generator.hs\",Stack {component = Just \"generator:exe:generator-exe\", stackYaml = Nothing})\n(\"./test\",Stack {component = Just \"generator:test:generator-test\", stackYaml = Nothing})\n",
        "range": {
          "start": {
            "line": 0,
            "character": 0
          },
          "end": {
            "line": 1,
            "character": 0
          }
        }
      }
    ]
  }
}


[Trace - 04:28:58 ] Sending request 'textDocument/hover - (8)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:28:58 ] Received response 'textDocument/codeAction - (7)' in 9ms.
Result: []


[Trace - 04:28:58 ] Received response 'textDocument/hover - (8)' in 8ms.
Result: null


[Trace - 04:28:58 ] Sending request 'textDocument/codeAction - (9)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": [
      {
        "source": "cradle",
        "severity": 1,
        "message": "Multi Cradle: No prefixes matched\npwd: /home/martin/Schreibtisch/lnthesis/code/generator\nfilepath: /home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs\nprefixes:\n(\"./src\",Stack {component = Just \"generator:lib\", stackYaml = Nothing})\n(\"./app/Main.hs\",Stack {component = Just \"generator:exe:generator-exe\", stackYaml = Nothing})\n(\"./app/Paths_generator.hs\",Stack {component = Just \"generator:exe:generator-exe\", stackYaml = Nothing})\n(\"./test\",Stack {component = Just \"generator:test:generator-test\", stackYaml = Nothing})\n",
        "range": {
          "start": {
            "line": 0,
            "character": 0
          },
          "end": {
            "line": 1,
            "character": 0
          }
        }
      }
    ]
  }
}


[Trace - 04:28:58 ] Sending request 'textDocument/documentHighlight - (10)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:28:58 ] Received response 'textDocument/codeAction - (9)' in 10ms.
Result: []


[Trace - 04:28:58 ] Received response 'textDocument/documentHighlight - (10)' in 8ms.
Result: []


[Trace - 04:29:08 ] Sending notification 'textDocument/didClose'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Schreibtisch/lnthesis/code/generator/app/Main.hs"
  }
}

And here's the log of an error-free session:

[Trace - 04:30:03 ] Sending request 'initialize - (11)'.
Params: {
  "processId": null,
  "rootPath": "/home/martin/Doks/uni/master/thesis/code/generator",
  "clientInfo": {
    "name": "emacs",
    "version": "GNU Emacs 27.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4)\n of 2021-08-07"
  },
  "rootUri": "file:///home/martin/Doks/uni/master/thesis/code/generator",
  "capabilities": {
    "workspace": {
      "workspaceEdit": {
        "documentChanges": true,
        "resourceOperations": [
          "create",
          "rename",
          "delete"
        ]
      },
      "applyEdit": true,
      "symbol": {
        "symbolKind": {
          "valueSet": [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26
          ]
        }
      },
      "executeCommand": {
        "dynamicRegistration": false
      },
      "didChangeWatchedFiles": {
        "dynamicRegistration": true
      },
      "workspaceFolders": true,
      "configuration": true,
      "fileOperations": {
        "didCreate": false,
        "willCreate": false,
        "didRename": false,
        "willRename": false,
        "didDelete": false,
        "willDelete": false
      }
    },
    "textDocument": {
      "declaration": {
        "linkSupport": true
      },
      "definition": {
        "linkSupport": true
      },
      "implementation": {
        "linkSupport": true
      },
      "typeDefinition": {
        "linkSupport": true
      },
      "synchronization": {
        "willSave": true,
        "didSave": true,
        "willSaveWaitUntil": true
      },
      "documentSymbol": {
        "symbolKind": {
          "valueSet": [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26
          ]
        },
        "hierarchicalDocumentSymbolSupport": true
      },
      "formatting": {
        "dynamicRegistration": true
      },
      "rangeFormatting": {
        "dynamicRegistration": true
      },
      "rename": {
        "dynamicRegistration": true,
        "prepareSupport": true
      },
      "codeAction": {
        "dynamicRegistration": true,
        "isPreferredSupport": true,
        "codeActionLiteralSupport": {
          "codeActionKind": {
            "valueSet": [
              "",
              "quickfix",
              "refactor",
              "refactor.extract",
              "refactor.inline",
              "refactor.rewrite",
              "source",
              "source.organizeImports"
            ]
          }
        },
        "resolveSupport": {
          "properties": [
            "edit",
            "command"
          ]
        },
        "dataSupport": true
      },
      "completion": {
        "completionItem": {
          "snippetSupport": true,
          "documentationFormat": [
            "markdown",
            "plaintext"
          ],
          "resolveAdditionalTextEditsSupport": true,
          "insertReplaceSupport": true,
          "resolveSupport": {
            "properties": [
              "documentation",
              "details",
              "additionalTextEdits",
              "command"
            ]
          },
          "insertTextModeSupport": {
            "valueSet": [
              1,
              2
            ]
          }
        },
        "contextSupport": true
      },
      "signatureHelp": {
        "signatureInformation": {
          "parameterInformation": {
            "labelOffsetSupport": true
          }
        }
      },
      "documentLink": {
        "dynamicRegistration": true,
        "tooltipSupport": true
      },
      "hover": {
        "contentFormat": [
          "markdown",
          "plaintext"
        ]
      },
      "foldingRange": {
        "dynamicRegistration": true
      },
      "callHierarchy": {
        "dynamicRegistration": false
      },
      "publishDiagnostics": {
        "relatedInformation": true,
        "tagSupport": {
          "valueSet": [
            1,
            2
          ]
        },
        "versionSupport": true
      },
      "moniker": null,
      "linkedEditingRange": null
    },
    "window": {
      "workDoneProgress": true,
      "showMessage": null,
      "showDocument": null
    }
  },
  "initializationOptions": null,
  "workDoneToken": "1"
}


[Trace - 04:30:03 ] Received response 'initialize - (11)' in 269ms.
Result: {
  "capabilities": {
    "codeActionProvider": true,
    "workspaceSymbolProvider": true,
    "textDocumentSync": {
      "openClose": true,
      "change": 2,
      "save": {
      }
    },
    "documentSymbolProvider": true,
    "codeLensProvider": {
      "workDoneProgress": null,
      "resolveProvider": null
    },
    "selectionRangeProvider": null,
    "referencesProvider": true,
    "documentFormattingProvider": true,
    "definitionProvider": true,
    "workspace": {
      "workspaceFolders": {
        "changeNotifications": true,
        "supported": true
      }
    },
    "completionProvider": {
      "triggerCharacters": [
        "."
      ],
      "resolveProvider": null
    },
    "implementationProvider": null,
    "documentHighlightProvider": true,
    "documentRangeFormattingProvider": true,
    "executeCommandProvider": {
      "commands": [
        "34094:tactics:tacticsAutoCommand",
        "34094:tactics:tacticsIntrosCommand",
        "34094:tactics:tacticsDestructCommand",
        "34094:tactics:tacticsHomomorphismCommand",
        "34094:tactics:tacticsDestructLambdaCaseCommand",
        "34094:tactics:tacticsHomomorphismLambdaCaseCommand",
        "34094:tactics:tacticsDestructAllCommand",
        "34094:tactics:tacticsUseDataConCommand",
        "34094:tactics:tacticsRefineCommand",
        "34094:retrie:retrieCommand",
        "34094:class:addMinimalMethodPlaceholders",
        "34094:eval:evalCommand",
        "34094:importLens:ImportLensCommand",
        "34094:moduleName:edit",
        "34094:hlint:applyOne",
        "34094:hlint:applyAll",
        "34094:splice:expandTHSpliceInplace",
        "34094:ghcide-completions:extendImport",
        "34094:ghcide-type-lenses:typesignature.add"
      ]
    },
    "declarationProvider": null,
    "renameProvider": null,
    "colorProvider": null,
    "typeDefinitionProvider": true,
    "hoverProvider": true,
    "foldingRangeProvider": null
  }
}


[Trace - 04:30:03 ] Sending notification 'initialized'.
Params: {
}


[Trace - 04:30:03 ] Sending notification 'workspace/didChangeConfiguration'.
Params: {
  "settings": {
    "haskell": {
      "plugin": {
        "hlint": {
          "globalOn": true
        },
        "moduleName": {
          "globalOn": true
        },
        "refineImports": {
          "globalOn": true
        },
        "importLens": {
          "globalOn": true
        },
        "eval": {
          "globalOn": true
        },
        "retrie": {
          "globalOn": true
        },
        "tactic": {
          "globalOn": true
        },
        "brittany": {
          "globalOn": true
        },
        "stylish-haskell": {
          "globalOn": true
        },
        "ormolu": {
          "globalOn": true
        },
        "fourmolu": {
          "globalOn": true
        },
        "floskell": {
          "globalOn": true
        },
        "pragmas": {
          "globalOn": true
        },
        "ghcide": {
          "globalOn": true
        }
      },
      "hlintOn": true,
      "maxNumberOfProblems": 100,
      "diagnosticsOnChange": true,
      "liquidOn": false,
      "completionSnippetsOn": true,
      "formatOnImportOn": true,
      "formattingProvider": "ormolu"
    }
  }
}


[Trace - 04:30:03 ] Sending notification 'textDocument/didOpen'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs",
    "languageId": "haskell",
    "version": 0,
    "text": "module Main where\n\nimport Lib\n\nmain :: IO ()\nmain = someFunc\n"
  }
}


[Trace - 04:30:03 ] Sending request 'textDocument/documentSymbol - (12)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  }
}


[Trace - 04:30:03 ] Sending request 'textDocument/codeAction - (13)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:30:03 ] Sending request 'textDocument/documentHighlight - (14)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:30:03 ] Received request 'client/registerCapability - (0).
Params: {
  "registrations": [
    {
      "registerOptions": {
        "watchers": [
          {
            "globPattern": "**/*.hs",
            "kind": 7
          },
          {
            "globPattern": "**/*.hs-boot",
            "kind": 7
          },
          {
            "globPattern": "**/*.lhs",
            "kind": 7
          },
          {
            "globPattern": "**/*.lhs-boot",
            "kind": 7
          }
        ]
      },
      "method": "workspace/didChangeWatchedFiles",
      "id": "globalFileWatches"
    }
  ]
}


[Trace - 04:30:03 ] Sending response 'client/registerCapability - (0)'. Processing request took 33ms
Params: {
  "jsonrpc": "2.0",
  "id": 0,
  "result": null
}


[Trace - 04:30:03 ] Received request 'window/workDoneProgress/create - (1).
Params: {
  "token": 0
}


[Trace - 04:30:03 ] Sending response 'window/workDoneProgress/create - (1)'. Processing request took 0ms
Params: {
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}


[Trace - 04:30:03 ] Received notification '$/progress'.
Params: {
  "value": {
    "cancellable": null,
    "kind": "begin",
    "title": "Setting up generator (for app/Main.hs)"
  },
  "token": 0
}


[Trace - 04:30:03 ] Received response 'textDocument/documentHighlight - (14)' in 37ms.
Result: []


[Trace - 04:30:03 ] Received request 'window/workDoneProgress/create - (2).
Params: {
  "token": "15"
}


[Trace - 04:30:03 ] Sending response 'window/workDoneProgress/create - (2)'. Processing request took 0ms
Params: {
  "jsonrpc": "2.0",
  "id": 2,
  "result": null
}


[Trace - 04:30:03 ] Received notification '$/progress'.
Params: {
  "value": {
    "kind": "begin",
    "title": "Processing"
  },
  "token": "15"
}


[Trace - 04:30:04 ] Received notification '$/progress'.
Params: {
  "value": {
    "kind": "report",
    "message": "1/2"
  },
  "token": "15"
}


[Trace - 04:30:04 ] Sending request 'textDocument/documentSymbol - (15)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  }
}


[Trace - 04:30:04 ] Sending notification '$/cancelRequest'.
Params: {
  "id": 13
}


[Trace - 04:30:04 ] Sending request 'textDocument/codeAction - (16)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:30:04 ] Received notification '$/progress'.
Params: {
  "value": {
    "kind": "end"
  },
  "token": 0
}


[Trace - 04:30:04 ] Received response 'textDocument/documentSymbol - (15)' in 397ms.
Result: [
  {
    "name": "Main",
    "kind": 1,
    "children": [
      {
        "name": "imports",
        "kind": 2,
        "children": [
          {
            "name": "import Lib",
            "kind": 2,
            "range": {
              "start": {
                "line": 2,
                "character": 0
              },
              "end": {
                "line": 2,
                "character": 10
              }
            },
            "selectionRange": {
              "start": {
                "line": 2,
                "character": 0
              },
              "end": {
                "line": 2,
                "character": 10
              }
            }
          }
        ],
        "range": {
          "start": {
            "line": 2,
            "character": 0
          },
          "end": {
            "line": 2,
            "character": 10
          }
        },
        "selectionRange": {
          "start": {
            "line": 2,
            "character": 0
          },
          "end": {
            "line": 2,
            "character": 10
          }
        }
      },
      {
        "name": "main",
        "kind": 12,
        "range": {
          "start": {
            "line": 5,
            "character": 0
          },
          "end": {
            "line": 5,
            "character": 15
          }
        },
        "selectionRange": {
          "start": {
            "line": 5,
            "character": 0
          },
          "end": {
            "line": 5,
            "character": 15
          }
        }
      }
    ],
    "range": {
      "start": {
        "line": 0,
        "character": 0
      },
      "end": {
        "line": 9223372036854775807,
        "character": 0
      }
    },
    "selectionRange": {
      "start": {
        "line": 0,
        "character": 7
      },
      "end": {
        "line": 0,
        "character": 11
      }
    }
  }
]


[Trace - 04:30:04 ] Received response 'textDocument/documentSymbol - (12)' in 647ms.
Result: [
  {
    "name": "Main",
    "kind": 1,
    "children": [
      {
        "name": "imports",
        "kind": 2,
        "children": [
          {
            "name": "import Lib",
            "kind": 2,
            "range": {
              "start": {
                "line": 2,
                "character": 0
              },
              "end": {
                "line": 2,
                "character": 10
              }
            },
            "selectionRange": {
              "start": {
                "line": 2,
                "character": 0
              },
              "end": {
                "line": 2,
                "character": 10
              }
            }
          }
        ],
        "range": {
          "start": {
            "line": 2,
            "character": 0
          },
          "end": {
            "line": 2,
            "character": 10
          }
        },
        "selectionRange": {
          "start": {
            "line": 2,
            "character": 0
          },
          "end": {
            "line": 2,
            "character": 10
          }
        }
      },
      {
        "name": "main",
        "kind": 12,
        "range": {
          "start": {
            "line": 5,
            "character": 0
          },
          "end": {
            "line": 5,
            "character": 15
          }
        },
        "selectionRange": {
          "start": {
            "line": 5,
            "character": 0
          },
          "end": {
            "line": 5,
            "character": 15
          }
        }
      }
    ],
    "range": {
      "start": {
        "line": 0,
        "character": 0
      },
      "end": {
        "line": 9223372036854775807,
        "character": 0
      }
    },
    "selectionRange": {
      "start": {
        "line": 0,
        "character": 7
      },
      "end": {
        "line": 0,
        "character": 11
      }
    }
  }
]


[Trace - 04:30:04 ] Received request 'window/workDoneProgress/create - (3).
Params: {
  "token": "29"
}


[Trace - 04:30:04 ] Sending response 'window/workDoneProgress/create - (3)'. Processing request took 0ms
Params: {
  "jsonrpc": "2.0",
  "id": 3,
  "result": null
}


[Trace - 04:30:04 ] Received notification '$/progress'.
Params: {
  "value": {
    "kind": "begin",
    "title": "Indexing"
  },
  "token": "29"
}


[Trace - 04:30:04 ] Received notification '$/progress'.
Params: {
  "value": {
    "kind": "report",
    "message": " (0/1)..."
  },
  "token": "29"
}


[Trace - 04:30:04 ] Received notification '$/progress'.
Params: {
  "value": {
    "kind": "end"
  },
  "token": "15"
}


[Trace - 04:30:04 ] Received notification '$/progress'.
Params: {
  "value": {
    "kind": "end",
    "message": "Finished indexing 1 files"
  },
  "token": "29"
}


[Trace - 04:30:04 ] Received response 'textDocument/codeAction - (16)' in 563ms.
Result: []


[Trace - 04:30:04 ] Received response 'nil - (13)' in 0ms.
Result: []


[Trace - 04:30:06 ] Sending request 'textDocument/codeAction - (17)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 0
    },
    "end": {
      "line": 2,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:30:06 ] Sending request 'textDocument/hover - (18)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 2,
    "character": 0
  }
}


[Trace - 04:30:06 ] Received response 'textDocument/hover - (18)' in 3ms.
Result: {
  "contents": {
    "value": "",
    "kind": "markdown"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 0
    },
    "end": {
      "line": 2,
      "character": 10
    }
  }
}


[Trace - 04:30:06 ] Received response 'textDocument/codeAction - (17)' in 32ms.
Result: [
  {
    "kind": "quickfix",
    "title": "Make all imports explicit",
    "edit": {
      "changes": {
        "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs": [
          {
            "newText": "import Lib ( someFunc )",
            "range": {
              "start": {
                "line": 2,
                "character": 0
              },
              "end": {
                "line": 2,
                "character": 10
              }
            }
          }
        ]
      }
    }
  }
]


[Trace - 04:30:06 ] Sending request 'textDocument/codeAction - (19)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 0
    },
    "end": {
      "line": 2,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:30:06 ] Sending request 'textDocument/documentHighlight - (20)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 2,
    "character": 0
  }
}


[Trace - 04:30:06 ] Sending request 'textDocument/hover - (21)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 2,
    "character": 0
  }
}


[Trace - 04:30:06 ] Received response 'textDocument/documentHighlight - (20)' in 35ms.
Result: []


[Trace - 04:30:06 ] Received response 'textDocument/hover - (21)' in 33ms.
Result: {
  "contents": {
    "value": "",
    "kind": "markdown"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 0
    },
    "end": {
      "line": 2,
      "character": 10
    }
  }
}


[Trace - 04:30:06 ] Received response 'textDocument/codeAction - (19)' in 69ms.
Result: [
  {
    "kind": "quickfix",
    "title": "Make all imports explicit",
    "edit": {
      "changes": {
        "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs": [
          {
            "newText": "import Lib ( someFunc )",
            "range": {
              "start": {
                "line": 2,
                "character": 0
              },
              "end": {
                "line": 2,
                "character": 10
              }
            }
          }
        ]
      }
    }
  }
]


[Trace - 04:30:08 ] Sending request 'textDocument/codeAction - (22)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:30:08 ] Sending request 'textDocument/hover - (23)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:30:08 ] Received response 'textDocument/hover - (23)' in 2ms.
Result: null


[Trace - 04:30:08 ] Received response 'textDocument/codeAction - (22)' in 25ms.
Result: []


[Trace - 04:30:08 ] Sending request 'textDocument/codeAction - (24)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:30:08 ] Sending request 'textDocument/documentHighlight - (25)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:30:08 ] Sending request 'textDocument/hover - (26)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:30:08 ] Received response 'textDocument/documentHighlight - (25)' in 7ms.
Result: []


[Trace - 04:30:08 ] Received response 'textDocument/codeAction - (24)' in 9ms.
Result: []


[Trace - 04:30:08 ] Received response 'textDocument/hover - (26)' in 6ms.
Result: null


[Trace - 04:38:30 ] Sending request 'textDocument/codeAction - (27)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:38:30 ] Sending request 'textDocument/hover - (28)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:38:30 ] Received response 'textDocument/hover - (28)' in 2ms.
Result: null


[Trace - 04:38:30 ] Received response 'textDocument/codeAction - (27)' in 25ms.
Result: []


[Trace - 04:38:31 ] Sending request 'textDocument/codeAction - (29)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 04:38:31 ] Sending request 'textDocument/documentHighlight - (30)'.
Params: {
  "textDocument": {
    "uri": "file:///home/martin/Doks/uni/master/thesis/code/generator/app/Main.hs"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 04:38:31 ] Received response 'textDocument/documentHighlight - (30)' in 1ms.
Result: []


[Trace - 04:38:31 ] Received response 'textDocument/codeAction - (29)' in 3ms.
Result: []
@michaelpj
Copy link
Collaborator

What happens if you run haskell-language-server path/to/symlink?

@MartinGas
Copy link
Author

I'm not sure what you mean there. Using the full path to the project ~/Doks/uni/master/thesis/code/generator/ (without symlinks) works as shown above. To clarify, the link lnthesis is the prefix ~/Doks/uni/master/thesis/ of the project's directory. Running haskell-language-server ~/Doks/uni/master/thesis/ just prints a bunch of the following errors:

ghcide compiled against GHC 8.8.4 but currently using 8.10.4
This is unsupported, ghcide must be compiled with the same GHC version as the project.

Please let me know if that's not what you had in mind.

@michaelpj
Copy link
Collaborator

I meant:

  • Go to the project root
  • Run haskell-language-server (or, I guess, haskell-language-server-wrapper if you're using that) giving it the path which is problematic. That should get it to try and load it, and hopefully exhibit the issue.

I know you said you ran haskell-language-server in the project directory already and didn't get errors, but perhaps it's not loading the file in that case.

@MartinGas
Copy link
Author

I see. It's just a bare bones stack project so I checked src/Lib.hs test/Spec.hs and app/Main.hs' running haskell-language-server-wrapper ` . None of the commands issues any errors. To be thorough, I checked this for both the full path and the one with the symlink.
What got me thinking about an issue on the Emacs side of things is that I was prompted to add the project twice depending on whether I was using the the full path or the symlink.

@michaelpj
Copy link
Collaborator

I'm still not sure I understand what you're doing. You're saying that the entire project is in a symlinked directory, or that specific files are symlinked?

It does sound like this might be an emacs issue, you might want to ask in lsp-mode.

@MartinGas
Copy link
Author

The project root is a subdirectory of a symlinked directory. There are no symlinks within the project's directories.

I'll head over to the lsp-mode project then. Do you have any idea what the problem might be there? What makes you think that lsp-mode is the actual cause? Thanks for your help!

@michaelpj
Copy link
Collaborator

lsp-haskell really just provides a few extra pieces for lsp-mode, so most of the logic is there. haskell-language-server likewise mostly gets fed paths by emacs. So if there's an issue with how emacs sends paths to haskell-language-server, it's almost certainly an lsp-mode issue.

If you can reproduce something weird happening with just the HLS binary then it might be a HLS issue, that's why I asked about that.

@ghost
Copy link

ghost commented Oct 1, 2021

I think I have the same problem, and it's maybe related to this: haskell/haskell-language-server#1971

let's say ~/htest is a symlink to /mnt/projects/htest (single component cabal project root). When visisting .hs files for the first time, emacs automatically asks this (quoted code copied from lsp--find-root-interactively):

"%s is not part of any project. Select action:

%s==>Import project root %s.
%s==>Import project by selecting root directory interactively.
%s==>Do not ask again for the current project by adding %s to lsp-session-folders-blacklist.
%s==>Do not ask again for the current project by selecting ignore path interactively.
%s==>Do nothing: ask again when opening other files from the current project."

1. By choosing "import project by selecting root directory interactively" and then picking ~/htest, HLS will always fail with "Multi Cradle: No prefixes matched".

lsp-haskell::stderr

setInitialDynFlags cradle: Cradle {cradleRootDir = "/home/me/htest", cradleOptsProg = CradleAction: Cabal}
Output from setting up the cradle Cradle {cradleRootDir = "/home/me/htest", cradleOptsProg = CradleAction: Cabal}

2. If instead I choose the real path, it works.

lsp-haskell::stderr

setInitialDynFlags cradle: Cradle {cradleRootDir = "/mnt/projects/htest", cradleOptsProg = CradleAction: Cabal}
Output from setting up the cradle Cradle {cradleRootDir = "/mnt/projects/htest", cradleOptsProg = CradleAction: Cabal}

Both 1. and 2. are true while vistiting .hs files under the symlinked path or the real one.

$ haskell-language-server runs with no errors both under the symlinked path and the real one.

I did a lot of testing taking care of killing emacs before each test, removing the .lsp-sessions-v1 file, etc. Also I tried with and without hie.yaml files, with single and multi component projects, with HLS 1.2 and then 1.4 and finally reduced the problem to this which happens in any case.

EDIT: Of course, I could always select the real project root (as in 2.) but then, emacs will keep asking for the project root every time I load the same .hs file by visiting the symlink. Also my real path under /mnt is in fact quite harder to find, I just simplified things here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants