Skip to content

No working feature using vscode and hls in wsl2, nix and devcontainer #2213

Open
@jneira

Description

@jneira

I don't understand what's I am missing. I am in WSL2, using nix, run nix-shell just to get GHC and cabal-install, ormolu, hlint, etc. Then I run vscode-insiders inside nix-shell. Run VSCode, and it downloaded haskell-language-server based on my GHC version.

  • Startup screenshot with the log

imagen

  • Text log when trying to format document:
2021-09-18 22:25:42.407052 [ThreadId 11] DEBUG hls:    Initializing exports map from hiedb
2021-09-18 22:25:42.4080647 [ThreadId 5] INFO hls:    Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri 6384748390871118630 "file:///workspace"], clientSettings = hashed Nothing}
2021-09-18 22:25:44.2168109 [ThreadId 11] DEBUG hls:    Done initializing exports map from hiedb (0)

2021-09-18 22:25:44.2173156 [ThreadId 12] DEBUG hls:    Configuration changed: Object (fromList [("haskell",Object (fromList [("diagnosticsOnChange",Bool True),("formatOnImportOn",Bool True),("formattingProvider",String "ormolu"),("indentationRules",Object (fromList [("enabled",Bool True)])),("logFile",String "/workspace/hls.log"),("plugin",Object (fromList [("class",Object (fromList [("globalOn",Bool True)])),("eval",Object (fromList [("globalOn",Bool True)])),("ghcide-completions",Object (fromList [("config",Object (fromList [("autoExtendOn",Bool True),("snippetsOn",Bool True)]))])),("ghcide-hover-and-symbols",Object (fromList [("hoverOn",Bool True)])),("ghcide-type-lenses",Object (fromList [("config",Object (fromList [("mode",Bool True)])),("globalOn",Bool True)])),("haddockComments",Object (fromList [("globalOn",Bool False)])),("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)])),("retrie",Object (fromList [("globalOn",Bool False)])),("splice",Object (fromList [("globalOn",Bool True)])),("tactics",Object (fromList [("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)])),("globalOn",Bool True)]))])),("releasesURL",String ""),("serverExecutablePath",String ""),("trace",Object (fromList [("client",String "debug"),("server",String "messages")])),("updateBehavior",String "keep-up-to-date")]))])
2021-09-18 22:25:44.2182896

2021-09-18 22:25:44.2182896 [ThreadId 15] DEBUG hls:    Finishing build session(exception: AsyncCancelled)
2021-09-18 22:25:44.2186516 [ThreadId 12] DEBUG hls:    Restarting build session for keys [GetClientSettings; ] (aborting the previous one took 0.00s)
2021-09-18 22:25:44.2191108 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:25:44.219413 [ThreadId 21] DEBUG hls:    Finishing build session(exception: AsyncCancelled)
2021-09-18 22:25:44.2213507 [ThreadId 12] DEBUG hls:    Restarting build session for keys [IsFileOfInterest; /workspace/backend/app/Main.hs,GetClientSettings; ,GetModificationTime_ {missingFileDiagnostics = True}; /workspace/backend/app/Main.hs] (aborting the previous one took 0.00s)
2021-09-18 22:25:44.2217856 [ThreadId 12] DEBUG hls:    Opened text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:25:56.6266243 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:25:56.6269688 [ThreadId 12] DEBUG hls:    Closed text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:26:07.6088759 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:26:07.6096783 [ThreadId 27] DEBUG hls:    Finishing build session(exception: AsyncCancelled)
2021-09-18 22:26:07.6100605 [ThreadId 12] DEBUG hls:    Restarting build session for keys [IsFileOfInterest; /workspace/backend/app/Main.hs,GetClientSettings; ,GetModificationTime_ {missingFileDiagnostics = True}; /workspace/backend/app/Main.hs] (aborting the previous one took 0.00s)

2021-09-18 22:26:07.6106107 [ThreadId 12] DEBUG hls:    Opened text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:26:19.337648 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:26:19.3383706 [ThreadId 12] DEBUG hls:    Closed text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:27:30.7177598 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:27:30.7185928 [ThreadId 55] DEBUG hls:    Finishing build session(exception: AsyncCancelled)
2021-09-18 22:27:30.7189886 [ThreadId 12] DEBUG hls:    Restarting build session for keys [IsFileOfInterest; /workspace/backend/app/Main.hs,GetClientSettings; ,GetModificationTime_ {missingFileDiagnostics = True}; /workspace/backend/app/Main.hs] (aborting the previous one took 0.00s)
2021-09-18 22:27:30.7192878 [ThreadId 12] DEBUG hls:    Opened text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:27:41.0161999 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList [(NormalizedFilePath "/workspace/backend/app/Main.hs",Modified {firstOpen = True})]
2021-09-18 22:27:41.0176708 [ThreadId 126] DEBUG hls:    Finishing build session(exception: AsyncCancelled)
2021-09-18 22:27:41.0183568 [ThreadId 12] DEBUG hls:    Restarting build session for keys [IsFileOfInterest; /workspace/backend/app/Main.hs,GetClientSettings; ,GetModificationTime_ {missingFileDiagnostics = True}; /workspace/backend/app/Main.hs] (aborting the previous one took 0.00s)
2021-09-18 22:27:41.018961 [ThreadId 12] DEBUG hls:    Modified text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:32:50.938515 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList [(NormalizedFilePath "/workspace/backend/app/Main.hs",Modified {firstOpen = False})]
2021-09-18 22:32:50.9392128 

2021-09-18 22:32:50.9392128 [ThreadId 178] DEBUG hls:    Finishing build session(exception: AsyncCancelled)
2021-09-18 22:32:50.9396042 [ThreadId 12] DEBUG hls:    Restarting build session for keys [IsFileOfInterest; /workspace/backend/app/Main.hs,GetClientSettings; ,GetModificationTime_ {missingFileDiagnostics = True}; /workspace/backend/app/Main.hs] (aborting the previous one took 0.00s)
2021-09-18 22:32:50.9401089 [ThreadId 12] DEBUG hls:    Saved text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:36:38.6770001 [ThreadId 11] DEBUG hls:    Initializing exports map from hiedb
2021-09-18 22:36:38.6779851 [ThreadId 5] INFO hls:    Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri 6384748390871118630 "file:///workspace"], clientSettings = hashed Nothing}
2021-09-18 22:36:40.072473 [ThreadId 11] DEBUG hls:    Done initializing exports map from hiedb (0)

2021-09-18 22:36:40.0730674 [ThreadId 12] DEBUG hls:    Configuration changed: Object (fromList [("haskell",Object (fromList [("diagnosticsOnChange",Bool True),("formatOnImportOn",Bool True),("formattingProvider",String "ormolu"),("indentationRules",Object (fromList [("enabled",Bool True)])),("logFile",String "/workspace/hls.log"),("plugin",Object (fromList [("class",Object (fromList [("globalOn",Bool True)])),("eval",Object (fromList [("globalOn",Bool True)])),("ghcide-completions",Object (fromList [("config",Object (fromList [("autoExtendOn",Bool True),("snippetsOn",Bool True)]))])),("ghcide-hover-and-symbols",Object (fromList [("hoverOn",Bool True)])),("ghcide-type-lenses",Object (fromList [("config",Object (fromList [("mode",Bool True)])),("globalOn",Bool True)])),("haddockComments",Object (fromList [("globalOn",Bool False)])),("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)])),("retrie",Object (fromList [("globalOn",Bool False)])),("splice",Object (fromList [("globalOn",Bool True)])),("tactics",Object (fromList [("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)])),("globalOn",Bool True)]))])),("releasesURL",String ""),("serverExecutablePath",String ""),("trace",Object (fromList [("client",String "debug"),("server",String "messages")])),("updateBehavior",String "keep-up-to-date")]))])

2021-09-18 22:36:40.074375 [ThreadId 15] DEBUG hls:    Finishing build session(exception: AsyncCancelled)
2021-09-18 22:36:40.0747424 [ThreadId 12] DEBUG hls:    Restarting build session for keys [GetClientSettings; ] (aborting the previous one took 0.00s)
2021-09-18 22:36:40.0752283 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:36:40.0757163 [ThreadId 12] DEBUG hls:    Restarting build session for keys [IsFileOfInterest; /workspace/backend/app/Main.hs,GetClientSettings; ,GetModificationTime_ {missingFileDiagnostics = True}; /workspace/backend/app/Main.hs] (aborting the previous one took 0.00s)
2021-09-18 22:36:40.0760422 [ThreadId 20] DEBUG hls:    Finishing build session(exception: AsyncCancelled)
2021-09-18 22:36:40.0763495 [ThreadId 12] DEBUG hls:    Opened text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:37:09.9746085 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:37:09.9750556 [ThreadId 12] DEBUG hls:    Closed text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:37:19.8294147 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:37:19.8304653 [ThreadId 26] DEBUG hls:    Finishing build session(exception: AsyncCancelled)

2021-09-18 22:37:19.8309545 [ThreadId 12] DEBUG hls:    Restarting build session for keys [IsFileOfInterest; /workspace/backend/app/Main.hs,GetClientSettings; ,GetModificationTime_ {missingFileDiagnostics = True}; /workspace/backend/app/Main.hs] (aborting the previous one took 0.00s)
2021-09-18 22:37:19.831567 [ThreadId 12] DEBUG hls:    Opened text document: file:///workspace/backend/app/Main.hs
2021-09-18 22:37:28.6524016 [ThreadId 12] DEBUG hls:    Set files of interest to: fromList []
2021-09-18 22:37:28.6537725 [ThreadId 12] DEBUG hls:    Closed text document: file:///workspace/backend/app/Main.hs

Metadata

Metadata

Assignees

No one assigned

    Labels

    os: nixosos: windowstype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions