简体   繁体   中英

ghc-9.2.5 is not supported by haskell plugin in vscode but I can't use other ghc versions

I'm new to Haskell and I am trying to setup haskell plugin in vscode using official haskell plugin but I came with up some problems with setting up code hinting and syntax recognition of hls plugin.

I have already installed ghc-9.2.4 and 9.2.3(by ghcup) since they are fully supported by the plugin but 9.2.5 which is recommended isn't supported. I also installed these two virsions in stack as well.

VsCode told me that HLS does not support GHC 9.2.5 yet so at first I tried to change my ghc version to 9.2.4 but I don't know how. I also tried to reinstall stack and reinstall ghc in stack but also failed.

Sometimes command line just report " YAML parse exception at line 9, column 18: mapping values are not allowed in this context " when I try to use stack command after reinstalling stack and ghc.

So I'd like to ask about how to decide which ghc to use in the setting manually, or if there is another way to solve this problem.

Thanks a lot for your help in advance.

You can tell the Haskell extension which version of ghc it should use via your settings.json:

{
    "haskell.toolchain": {
     "ghc": "9.2.4"
    }
}

Source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM