haskell / vscode-haskell

VS Code extension for Haskell, powered by haskell-language-server
https://marketplace.visualstudio.com/items?itemName=haskell.haskell
Other
561 stars 90 forks source link

Multi Cradle Error when hs-source-dirs is in a common stanza #770

Closed lsmor closed 1 year ago

lsmor commented 1 year ago

Your environment

Ubuntu 22.04.1 LTS vscode ghcup-0.1.18.0 cabal-3.8.1.0 hls-1.8.0.0 ghc-9.2.4

tools installed via ghcup

Steps to reproduce

Create a cabal project with a common stanza which includes hs-source-dirs: For example

main :: IO () main = putStrLn "Hello HLS"


- advent-of-code.cabal file
```cabal
common deps
  build-depends:
     base >=4.7 && <5
  other-modules:
      Paths_advent_of_code
  hs-source-dirs:
      solutions
  default-language: Haskell2010

executable advent-of-code-day-1
  import: deps
  main-is: day-1.hs

Expected behaviour

hls should work normaly, as cabal is able to build the project.

Actual behaviour

hls is somehow wrong about the working directory and shows this error at the top of the day-1.hs file

Multi Cradle: No prefixes matched
pwd: path/to/project
filepath: path/to/project/solutions/day-1.hs
prefixes:
("./day-1.hs",Cabal {component = Just "advent-of-code:exe:day-1"})

Notice, that prefixes shows ./day-1.hs instead of right path solutions/day-1.hs

Include debug information

executable advent-of-code-day-1 import: deps hs-source-dirs: solutions main-is: day-1.hs


`hls` works fine with that cabal file. Despite of having a easy solution I think it is worth reporting it, since to me it looks like a bug. Below, I include the logs after running "restart haskell LSP server" 

<details>
<summary>
Debug output:
</summary>

[Info - 14:36:04] Stopping the server [Trace - 14:36:04] Sending request 'shutdown - (4)'. 2022-12-03T13:36:04.187170Z | Debug | Received shutdown message [Trace - 14:36:04] Received notification 'window/logMessage'. Received shutdown message 2022-12-03T13:36:04.188030Z | Debug | Finished build session AsyncCancelled [Trace - 14:36:04] Received response 'shutdown - (4)' in 3ms. [Trace - 14:36:04] Sending notification 'exit'. [Info - 14:36:04] Starting the server [Trace - 14:36:04] Sending request 'initialize - (0)'. 2022-12-03T13:36:04.231736Z | Error | Got EOF No 'hie.yaml' found. Try to discover the project type! Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.8.0.0 x86_64 ghc-8.10.7 Current directory: /path/to/project/advent-of-code/AoC-2022 Operating system: linux Arguments: ["--lsp","-d"] Cradle directory: /path/to/project/advent-of-code/AoC-2022 Cradle type: Cabal

Tool versions found on the $PATH cabal: 3.8.1.0 stack: 2.9.1 ghc: 9.2.4

Consulting the cradle to get project GHC version... Project GHC version: 9.2.4 haskell-language-server exe candidates: ["haskell-language-server-9.2.4","haskell-language-server"] Launching haskell-language-server exe at:/path/to/.ghcup/bin/haskell-language-server-9.2.4 2022-12-03T13:36:06.828767Z | Info | No log file specified; using stderr. 2022-12-03T13:36:06.829535Z | Info | haskell-language-server version: 1.8.0.0 (GHC: 9.2.4) (PATH: /path/to/.ghcup/hls/1.8.0.0/lib/haskell-language-server-1.8.0.0/bin/haskell-language-server-9.2.4) 2022-12-03T13:36:06.830746Z | Info | Directory: /path/to/project/advent-of-code/AoC-2022 2022-12-03T13:36:06.831281Z | Info | Starting (haskell-language-server) LSP server... GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False} PluginIds: [ pragmas , LSPRecorderCallback , rename , ghcide-completions , class , refineImports , changeTypeSignature , qualifyImportedNames , alternateNumberFormat , hlint , ghcide-code-actions-fill-holes , floskell , ghcide-extend-import-action , codeRange , importLens , retrie , ghcide-type-lenses , ghcide-code-actions-imports-exports , ghcide-hover-and-symbols , eval , gadt , fourmolu , callHierarchy , stylish-haskell , ghcide-code-actions-type-signatures , ghcide-code-actions-bindings , moduleName , ormolu , ghcide-core , explicitFixity ] 2022-12-03T13:36:06.838718Z | Info | Logging heap statistics every 60.00s 2022-12-03T13:36:06.842341Z | Info | Starting LSP server... If you are seeing this in a terminal, you probably should have run WITHOUT the --lsp option! PluginIds: [ pragmas , LSPRecorderCallback , rename , ghcide-completions , class , refineImports , changeTypeSignature , qualifyImportedNames , alternateNumberFormat , hlint , ghcide-code-actions-fill-holes , floskell , ghcide-extend-import-action , codeRange , importLens , retrie , ghcide-type-lenses , ghcide-code-actions-imports-exports , ghcide-hover-and-symbols , eval , gadt , fourmolu , callHierarchy , stylish-haskell , ghcide-code-actions-type-signatures , ghcide-code-actions-bindings , moduleName , ormolu , ghcide-core , explicitFixity ] 2022-12-03T13:36:06.843011Z | Info | Starting server 2022-12-03T13:36:06.846791Z | Info | Started LSP server in 0.00s 2022-12-03T13:36:07.302713Z | Debug | Setting initial dynflags... 2022-12-03T13:36:07.302918Z | Debug | shouldRunSubset: True 2022-12-03T13:36:07.303007Z | Warning | Currently, HLS supports GHC 9.2 only partially. See issue #2982 for more detail. 2022-12-03T13:36:07.303167Z | Debug | Initializing exports map from hiedb 2022-12-03T13:36:07.303581Z | Info | Registering IDE configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri (-4483041753667491287) "file:///path/to/project/advent-of-code/AoC-2022"], clientSettings = hashed Nothing} [Trace - 14:36:07] Received response 'initialize - (0)' in 3074ms. [Trace - 14:36:07] Sending notification 'initialized'. [Trace - 14:36:07] Sending notification 'workspace/didChangeConfiguration'. [Trace - 14:36:07] Sending notification 'textDocument/didOpen'. 2022-12-03T13:36:07.307789Z | Debug | Done initializing exports map from hiedb. Size: 9 2022-12-03T13:36:07.312499Z | Debug | Shake session initialized 2022-12-03T13:36:07.312711Z | Debug | Configuration changed: Object (fromList [("haskell",Object (fromList [("checkProject",Bool True),("formattingProvider",String "fourmolu"),("ghcupExecutablePath",String "${HOME}/.ghcup/bin/ghcup"),("indentationRules",Object (fromList [("enabled",Bool True)])),("logFile",String ""),("manageHLS",String "PATH"),("maxCompletions",Number 40.0),("metadataURL",String ""),("openDocumentationInHackage",Bool True),("openSourceInHackage",Bool True),("plugin",Object (fromList [("alternateNumberFormat",Object (fromList [("globalOn",Bool True)])),("callHierarchy",Object (fromList [("globalOn",Bool True)])),("changeTypeSignature",Object (fromList [("globalOn",Bool True)])),("class",Object (fromList [("globalOn",Bool True)])),("eval",Object (fromList [("config",Object (fromList [("diff",Bool True),("exception",Bool False)])),("globalOn",Bool True)])),("ghcide-code-actions-bindings",Object (fromList [("globalOn",Bool True)])),("ghcide-code-actions-fill-holes",Object (fromList [("globalOn",Bool True)])),("ghcide-code-actions-imports-exports",Object (fromList [("globalOn",Bool True)])),("ghcide-code-actions-type-signatures",Object (fromList [("globalOn",Bool True)])),("ghcide-completions",Object (fromList [("config",Object (fromList [("autoExtendOn",Bool True),("snippetsOn",Bool True)])),("globalOn",Bool True)])),("ghcide-hover-and-symbols",Object (fromList [("hoverOn",Bool True),("symbolsOn",Bool True)])),("ghcide-type-lenses",Object (fromList [("config",Object (fromList [("mode",String "always")])),("globalOn",Bool True)])),("haddockComments",Object (fromList [("globalOn",Bool True)])),("hlint",Object (fromList [("codeActionsOn",Bool True),("config",Object (fromList [("flags",Array [])])),("diagnosticsOn",Bool True)])),("importLens",Object (fromList [("codeActionsOn",Bool True),("codeLensOn",Bool True)])),("moduleName",Object (fromList [("globalOn",Bool True)])),("pragmas",Object (fromList [("codeActionsOn",Bool True),("completionOn",Bool True)])),("qualifyImportedNames",Object (fromList [("globalOn",Bool True)])),("refineImports",Object (fromList [("codeActionsOn",Bool True),("codeLensOn",Bool True)])),("rename",Object (fromList [("config",Object (fromList [("crossModule",Bool False)])),("globalOn",Bool True)])),("retrie",Object (fromList [("globalOn",Bool True)])),("splice",Object (fromList [("globalOn",Bool True)])),("tactics",Object (fromList [("codeActionsOn",Bool True),("codeLensOn",Bool True),("config",Object (fromList [("auto_gas",Number 4.0),("hole_severity",Null),("max_use_ctor_actions",Number 5.0),("proofstate_styling",Bool True),("timeout_duration",Number 2.0)])),("hoverOn",Bool True)]))])),("promptBeforeDownloads",String "true"),("releasesDownloadStoragePath",String ""),("releasesURL",String ""),("serverEnvironment",Object (fromList [])),("serverExecutablePath",String ""),("serverExtraArgs",String ""),("toolchain",Object (fromList [])),("trace",Object (fromList [("client",String "debug"),("server",String "messages")])),("upgradeGHCup",Bool False)]))]) 2022-12-03T13:36:07.314102Z | Debug | Finished build session AsyncCancelled 2022-12-03T13:36:07.314384Z | Debug | Restarting build session due to config change Action Queue: [] Keys: [GetClientSettings; ] Aborting previous build session took 0.00s 2022-12-03T13:36:07.315198Z | Debug | Set files of interest to: fromList [(NormalizedFilePath "/path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs",Modified {firstOpen = True})] 2022-12-03T13:36:07.315527Z | Debug | Finished build session AsyncCancelled 2022-12-03T13:36:07.315571Z | Debug | Restarting build session due to /path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs (modified) Action Queue: [] Keys: [ GetClientSettings; , GetModificationTime; /path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs , IsFileOfInterest; /path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs ] Aborting previous build session took 0.00s 2022-12-03T13:36:07.315939Z | Debug | Opened text document: file:///path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs 2022-12-03T13:36:07.316566Z | Debug | Getting hlint ideas for NormalizedFilePath "/path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs" [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] haskell-language-server version: 1.8.0.0 (GHC: 9.2.4) (PATH: /path/to/.ghcup/hls/1.8.0.0/lib/haskell-language-server-1.8.0.0/bin/haskell-language-server-9.2.4) [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] Directory: /path/to/project/advent-of-code/AoC-2022 [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] Starting (haskell-language-server) LSP server... GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False} PluginIds: [ pragmas , LSPRecorderCallback , rename , ghcide-completions , class , refineImports , changeTypeSignature , qualifyImportedNames , alternateNumberFormat , hlint , ghcide-code-actions-fill-holes , floskell , ghcide-extend-import-action , codeRange , importLens , retrie , ghcide-type-lenses , ghcide-code-actions-imports-exports , ghcide-hover-and-symbols , eval , gadt , fourmolu , callHierarchy , stylish-haskell , ghcide-code-actions-type-signatures , ghcide-code-actions-bindings , moduleName , ormolu , ghcide-core , explicitFixity ] [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] Logging heap statistics every 60.00s [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] Starting LSP server... If you are seeing this in a terminal, you probably should have run WITHOUT the --lsp option! PluginIds: [ pragmas , LSPRecorderCallback , rename , ghcide-completions , class , refineImports , changeTypeSignature , qualifyImportedNames , alternateNumberFormat , hlint , ghcide-code-actions-fill-holes , floskell , ghcide-extend-import-action , codeRange , importLens , retrie , ghcide-type-lenses , ghcide-code-actions-imports-exports , ghcide-hover-and-symbols , eval , gadt , fourmolu , callHierarchy , stylish-haskell , ghcide-code-actions-type-signatures , ghcide-code-actions-bindings , moduleName , ormolu , ghcide-core , explicitFixity ] [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] Starting server [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] Started LSP server in 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. Setting initial dynflags... [Trace - 14:36:07] Received notification 'window/logMessage'. shouldRunSubset: True [Trace - 14:36:07] Received notification 'window/logMessage'. [Warn - 14:36:07] Currently, HLS supports GHC 9.2 only partially. See issue #2982 for more detail. [Trace - 14:36:07] Received notification 'window/logMessage'. Initializing exports map from hiedb [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] Registering IDE configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri (-4483041753667491287) "file:///path/to/project/advent-of-code/AoC-2022"], clientSettings = hashed Nothing} [Trace - 14:36:07] Received notification 'window/logMessage'. Done initializing exports map from hiedb. Size: 9 [Trace - 14:36:07] Received notification 'window/logMessage'. Shake session initialized [Trace - 14:36:07] Received request 'client/registerCapability - (0)'. [Trace - 14:36:07] Sending response 'client/registerCapability - (0)'. Processing request took 0ms [Trace - 14:36:07] Received notification 'window/logMessage'. Configuration changed: Object (fromList [("haskell",Object (fromList [("checkProject",Bool True),("formattingProvider",String "fourmolu"),("ghcupExecutablePath",String "${HOME}/.ghcup/bin/ghcup"),("indentationRules",Object (fromList [("enabled",Bool True)])),("logFile",String ""),("manageHLS",String "PATH"),("maxCompletions",Number 40.0),("metadataURL",String ""),("openDocumentationInHackage",Bool True),("openSourceInHackage",Bool True),("plugin",Object (fromList [("alternateNumberFormat",Object (fromList [("globalOn",Bool True)])),("callHierarchy",Object (fromList [("globalOn",Bool True)])),("changeTypeSignature",Object (fromList [("globalOn",Bool True)])),("class",Object (fromList [("globalOn",Bool True)])),("eval",Object (fromList [("config",Object (fromList [("diff",Bool True),("exception",Bool False)])),("globalOn",Bool True)])),("ghcide-code-actions-bindings",Object (fromList [("globalOn",Bool True)])),("ghcide-code-actions-fill-holes",Object (fromList [("globalOn",Bool True)])),("ghcide-code-actions-imports-exports",Object (fromList [("globalOn",Bool True)])),("ghcide-code-actions-type-signatures",Object (fromList [("globalOn",Bool True)])),("ghcide-completions",Object (fromList [("config",Object (fromList [("autoExtendOn",Bool True),("snippetsOn",Bool True)])),("globalOn",Bool True)])),("ghcide-hover-and-symbols",Object (fromList [("hoverOn",Bool True),("symbolsOn",Bool True)])),("ghcide-type-lenses",Object (fromList [("config",Object (fromList [("mode",String "always")])),("globalOn",Bool True)])),("haddockComments",Object (fromList [("globalOn",Bool True)])),("hlint",Object (fromList [("codeActionsOn",Bool True),("config",Object (fromList [("flags",Array [])])),("diagnosticsOn",Bool True)])),("importLens",Object (fromList [("codeActionsOn",Bool True),("codeLensOn",Bool True)])),("moduleName",Object (fromList [("globalOn",Bool True)])),("pragmas",Object (fromList [("codeActionsOn",Bool True),("completionOn",Bool True)])),("qualifyImportedNames",Object (fromList [("globalOn",Bool True)])),("refineImports",Object (fromList [("codeActionsOn",Bool True),("codeLensOn",Bool True)])),("rename",Object (fromList [("config",Object (fromList [("crossModule",Bool False)])),("globalOn",Bool True)])),("retrie",Object (fromList [("globalOn",Bool True)])),("splice",Object (fromList [("globalOn",Bool True)])),("tactics",Object (fromList [("codeActionsOn",Bool True),("codeLensOn",Bool True),("config",Object (fromList [("auto_gas",Number 4.0),("hole_severity",Null),("max_use_ctor_actions",Number 5.0),("proofstate_styling",Bool True),("timeout_duration",Number 2.0)])),("hoverOn",Bool True)]))])),("promptBeforeDownloads",String "true"),("releasesDownloadStoragePath",String ""),("releasesURL",String ""),("serverEnvironment",Object (fromList [])),("serverExecutablePath",String ""),("serverExtraArgs",String ""),("toolchain",Object (fromList [])),("trace",Object (fromList [("client",String "debug"),("server",String "messages")])),("upgradeGHCup",Bool False)]))]) [Trace - 14:36:07] Received notification 'window/logMessage'. Finished build session AsyncCancelled [Trace - 14:36:07] Received notification 'window/logMessage'. Restarting build session due to config change Action Queue: [] Keys: [GetClientSettings; ] Aborting previous build session took 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. Set files of interest to: fromList [(NormalizedFilePath "/path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs",Modified {firstOpen = True})] [Trace - 14:36:07] Received notification 'window/logMessage'. Finished build session AsyncCancelled [Trace - 14:36:07] Received notification 'window/logMessage'. Restarting build session due to /path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs (modified) Action Queue: [] Keys: [ GetClientSettings; , GetModificationTime; /path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs , IsFileOfInterest; /path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs ] Aborting previous build session took 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. Opened text document: file:///path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs [Trace - 14:36:07] Received notification 'window/logMessage'. Getting hlint ideas for NormalizedFilePath "/path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs" [Trace - 14:36:07] Sending request 'textDocument/documentSymbol - (1)'. 2022-12-03T13:36:07.346244Z | Info | Cradle path: solutions/day-1.hs 2022-12-03T13:36:07.346482Z | Warning | No cradle found for solutions/day-1.hs. Proceeding with implicit cradle. You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error. 2022-12-03T13:36:07.353396Z | Debug | Cradle: Cradle {cradleRootDir = "/path/to/project/advent-of-code/AoC-2022", cradleOptsProg = CradleAction: Cabal} 2022-12-03T13:36:07.353685Z | Debug | Session loading result: Left [CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitSuccess, cradleErrorStderr = ["Multi Cradle: No prefixes matched","pwd: /path/to/project/advent-of-code/AoC-2022","filepath: /path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs","prefixes:","(\"./day-1.hs\",Cabal {component = Just \"advent-of-code:exe:day-1\"})"]}] 2022-12-03T13:36:07.354315Z | Debug | LOOKUP PERSISTENT FOR: GetParsedModule 2022-12-03T13:36:07.354422Z | Debug | Finished: Outline Took: 0.01s [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] Cradle path: solutions/day-1.hs [Trace - 14:36:07] Received notification 'window/logMessage'. [Warn - 14:36:07] No cradle found for solutions/day-1.hs. Proceeding with implicit cradle. You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error. [Trace - 14:36:07] Received request 'window/workDoneProgress/create - (1)'. [Trace - 14:36:07] Sending response 'window/workDoneProgress/create - (1)'. Processing request took 0ms [Trace - 14:36:07] Received notification '$/progress'. [Trace - 14:36:07] Received notification 'window/logMessage'. Cradle: Cradle {cradleRootDir = "/path/to/project/advent-of-code/AoC-2022", cradleOptsProg = CradleAction: Cabal} [Trace - 14:36:07] Received notification '$/progress'. [Trace - 14:36:07] Received notification 'window/logMessage'. Session loading result: Left [CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitSuccess, cradleErrorStderr = ["Multi Cradle: No prefixes matched","pwd: /path/to/project/advent-of-code/AoC-2022","filepath: /path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs","prefixes:","(\"./day-1.hs\",Cabal {component = Just \"advent-of-code:exe:day-1\"})"]}] [Trace - 14:36:07] Received notification 'textDocument/publishDiagnostics'. [Trace - 14:36:07] Received notification 'window/logMessage'. LOOKUP PERSISTENT FOR: GetParsedModule [Trace - 14:36:07] Received response 'textDocument/documentSymbol - (1)' in 22ms. [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: Outline Took: 0.01s 2022-12-03T13:36:07.423332Z | Debug | LOOKUP PERSISTENT FOR: GetModSummaryWithoutTimestamps 2022-12-03T13:36:07.423518Z | Debug | LOOKUP PERSISTENT FOR: GhcSessionDeps [Trace - 14:36:07] Received request 'window/workDoneProgress/create - (2)'. [Trace - 14:36:07] Sending response 'window/workDoneProgress/create - (2)'. Processing request took 0ms [Trace - 14:36:07] Received notification 'window/logMessage'. LOOKUP PERSISTENT FOR: GetModSummaryWithoutTimestamps [Trace - 14:36:07] Received notification 'window/logMessage'. LOOKUP PERSISTENT FOR: GhcSessionDeps [Trace - 14:36:07] Sending request 'textDocument/codeLens - (2)'. 2022-12-03T13:36:07.566065Z | Debug | Finished: classplugin.TypeCheck Took: 0.00s 2022-12-03T13:36:07.566837Z | Debug | src/Ide/Plugin/Eval/CodeLens.hs:157:15 "fp" "/path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs" 2022-12-03T13:36:07.567077Z | Debug | Finished: codeLens.GhcSession Took: 0.00s 2022-12-03T13:36:07.567977Z | Debug | ModuleName.CorrectNames: [Main] 2022-12-03T13:36:07.569550Z | Debug | LOOKUP PERSISTENT FOR: MinimalImports 2022-12-03T13:36:07.569585Z | Debug | Finished: codeLens.TypeCheck Took: 0.00s 2022-12-03T13:36:07.569825Z | Debug | LOOKUP PERSISTENT FOR: RefineImports 2022-12-03T13:36:07.570238Z | Info | ModuleName.BestName: Main 2022-12-03T13:36:07.570357Z | Debug | Finished: Took: 0.00s 2022-12-03T13:36:07.570443Z | Debug | LOOKUP PERSISTENT FOR: GetParsedModuleWithComments 2022-12-03T13:36:07.570638Z | Debug | Finished: codeLens.GetBindings Took: 0.00s 2022-12-03T13:36:07.570715Z | Debug | Finished: RefineImports Took: 0.00s 2022-12-03T13:36:07.571035Z | Debug | Finished: ModuleName.GetParsedModule Took: 0.00s 2022-12-03T13:36:07.571168Z | Debug | Finished: codeLens.GetGlobalBindingTypeSigs Took: 0.00s 2022-12-03T13:36:07.571179Z | Debug | ModuleName.StatedNameMaybe: 2022-12-03T13:36:07.571269Z | Debug | LOOKUP PERSISTENT FOR: GetEvalComments 2022-12-03T13:36:07.572567Z | Debug | Finished: eval.GetParsedModuleWithComments Took: 0.00s 2022-12-03T13:36:07.572672Z | Warning | InternalError: Unable to typecheck 2022-12-03T13:36:07.572749Z | Warning | InternalError: Exception in plugin PluginId "eval" while processing STextDocumentCodeLens: BadDependency "GetEvalComments" [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: classplugin.TypeCheck Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. src/Ide/Plugin/Eval/CodeLens.hs:157:15 "fp" "/path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs" [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: codeLens.GhcSession Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. ModuleName.CorrectNames: [Main] [Trace - 14:36:07] Received notification 'window/logMessage'. LOOKUP PERSISTENT FOR: MinimalImports [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: codeLens.TypeCheck Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. LOOKUP PERSISTENT FOR: RefineImports [Trace - 14:36:07] Received notification 'window/logMessage'. [Info - 14:36:07] ModuleName.BestName: Main [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. LOOKUP PERSISTENT FOR: GetParsedModuleWithComments [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: codeLens.GetBindings Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: RefineImports Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: ModuleName.GetParsedModule Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: codeLens.GetGlobalBindingTypeSigs Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. ModuleName.StatedNameMaybe: [Trace - 14:36:07] Received notification 'window/logMessage'. LOOKUP PERSISTENT FOR: GetEvalComments [Trace - 14:36:07] Received notification 'window/logMessage'. Finished: eval.GetParsedModuleWithComments Took: 0.00s [Trace - 14:36:07] Received notification 'window/logMessage'. [Warn - 14:36:07] InternalError: Unable to typecheck [Trace - 14:36:07] Received notification 'window/logMessage'. [Warn - 14:36:07] InternalError: Exception in plugin PluginId "eval" while processing STextDocumentCodeLens: BadDependency "GetEvalComments" [Trace - 14:36:07] Received response 'textDocument/codeLens - (2)' in 22ms. [Trace - 14:36:29] Sending request 'textDocument/codeLens - (3)'. 2022-12-03T13:36:29.827574Z | Debug | Finished: classplugin.TypeCheck Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: classplugin.TypeCheck Took: 0.00s 2022-12-03T13:36:29.828801Z | Debug | Finished: RefineImports Took: 0.00s 2022-12-03T13:36:29.829418Z | Debug | Finished: Took: 0.00s 2022-12-03T13:36:29.829908Z | Debug | Finished: codeLens.GhcSession Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: RefineImports Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: codeLens.GhcSession Took: 0.00s 2022-12-03T13:36:29.829921Z | Debug | src/Ide/Plugin/Eval/CodeLens.hs:157:15 "fp" "/path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs" 2022-12-03T13:36:29.830376Z | Debug | Finished: codeLens.TypeCheck Took: 0.00s 2022-12-03T13:36:29.830492Z | Debug | ModuleName.CorrectNames: [Main] 2022-12-03T13:36:29.832149Z | Debug | Finished: codeLens.GetBindings Took: 0.00s 2022-12-03T13:36:29.832310Z | Debug | Finished: eval.GetParsedModuleWithComments Took: 0.00s 2022-12-03T13:36:29.832350Z | Debug | Finished: codeLens.GetGlobalBindingTypeSigs Took: 0.00s 2022-12-03T13:36:29.833286Z | Info | ModuleName.BestName: Main 2022-12-03T13:36:29.834172Z | Debug | Finished: ModuleName.GetParsedModule Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. src/Ide/Plugin/Eval/CodeLens.hs:157:15 "fp" "/path/to/project/advent-of-code/AoC-2022/solutions/day-1.hs" 2022-12-03T13:36:29.834483Z | Debug | ModuleName.StatedNameMaybe: 2022-12-03T13:36:29.835110Z | Warning | InternalError: Unable to typecheck 2022-12-03T13:36:29.835512Z | Warning | InternalError: Exception in plugin PluginId "eval" while processing STextDocumentCodeLens: BadDependency "GetEvalComments" [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: codeLens.TypeCheck Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. ModuleName.CorrectNames: [Main] [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: codeLens.GetBindings Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: eval.GetParsedModuleWithComments Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: codeLens.GetGlobalBindingTypeSigs Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. [Info - 14:36:29] ModuleName.BestName: Main [Trace - 14:36:29] Received notification 'window/logMessage'. Finished: ModuleName.GetParsedModule Took: 0.00s [Trace - 14:36:29] Received notification 'window/logMessage'. ModuleName.StatedNameMaybe: [Trace - 14:36:29] Received notification 'window/logMessage'. [Warn - 14:36:29] InternalError: Unable to typecheck [Trace - 14:36:29] Received notification 'window/logMessage'. [Warn - 14:36:29] InternalError: Exception in plugin PluginId "eval" while processing STextDocumentCodeLens: BadDependency "GetEvalComments" [Trace - 14:36:29] Received response 'textDocument/codeLens - (3)' in 14ms.



</details>
fendor commented 1 year ago

Bug in implicit-hie https://github.com/Avi-D-coder/implicit-hie/issues/1

Try adding an explicit hie.yaml (right next to your .cabal file), with the contents:

cradle:
  cabal:
lsmor commented 1 year ago

Indeed the problem can be solve with either

fendor commented 1 year ago

Thanks, then closed as "not our responsibility"