在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):haskell/haskell-ide-engine开源软件地址(OpenSource Url):https://github.com/haskell/haskell-ide-engine开源编程语言(OpenSource Language):Haskell 99.5%开源软件介绍(OpenSource Introduction):DeprecatedThis repository is now an historical artifact. It was the original LSP support for haskell, which is now provided by https://github.com/haskell/haskell-language-server Haskell IDE Engine (HIE)This project aims to be the universal interface to a growing number of Haskell tools, providing a fully-featured Language Server Protocol server for editors and IDEs that require Haskell-specific functionality.
Features
InstallationInstallation with NixFollow the instructions at https://github.com/Infinisil/all-hies Installation on Arch LinuxA haskell-ide-engine package is available on the AUR. Install it using Aura:
To change which GHC versions are supported by HIE, use
and modify the value of Reducing the number of supported GHC versions makes HIE compile faster. Installation with GHC and HIE as a VS Code DevcontainerVS Code provides the ability to develop applications inside of a Docker container (called Devcontainers) https://code.visualstudio.com/docs/remote/containers There is a community Devcontainer setup which installs and configures GHC + HIE 8.6.5 and the necessary VS Code extensions to integrate them into the editor. https://github.com/hmemcpy/haskell-hie-devcontainer Installation from sourceTo install HIE, you need stack version >= 2.1.1. HIE builds from source code, so there's a couple of extra steps. Common pre-requirements
Tip: you can quickly check if some command is in your path by running the command. If you receive some meaningful output instead of "command not found"-like message then it means you have the command in PATH. Linux-specific pre-requirementsOn Linux you will need install a couple of extra libraries (for Unicode (ICU) and NCURSES): Debian 9/Ubuntu 18.04 or earlier: sudo apt install libicu-dev libtinfo-dev libgmp-dev Debian 10/Ubuntu 18.10 or later: sudo apt install libicu-dev libncurses-dev libgmp-dev # also zlib1g-dev if not installed Fedora: sudo dnf install libicu-devel ncurses-devel # also zlib-devel if not already installed Windows-specific pre-requirementsIn order to avoid problems with long paths on Windows you can do either one of the following:
In addition make sure Download the source codegit clone https://github.com/haskell/haskell-ide-engine --recurse-submodules
cd haskell-ide-engine BuildingUses the shake build system for predictable builds. Note, on first invocation of the build script, a GHC is being installed for execution.
The GHC used for the Available commands can be seen with: stack ./install.hs help Remember, this will take time to download a Stackage-LTS and an appropriate GHC. However, afterwards all commands should work as expected. Install via cabalThe install-script can be invoked via cabal v2-run ./install.hs --project-file install/shake.project <target> or using the existing alias script ./cabal-hie-install <target> Running the script with cabal on windows requires a cabal version greater or equal to For brevity, only the Install specific GHC VersionInstall hie for the latest available and supported GHC version (and hoogle docs): stack ./install.hs hie Install hie for a specific GHC version (and hoogle docs): stack ./install.hs hie-8.6.5
stack ./install.hs data The Haskell IDE Engine can also be built with An example output is: > cabal-hie-install ghcs
******************************************************************
Found the following GHC paths:
ghc-8.4.4: /opt/bin/ghc-8.4.4
ghc-8.6.2: /opt/bin/ghc-8.6.2
****************************************************************** If your desired ghc has been found, you use it to install Haskell IDE Engine. cabal-hie-install hie-8.4.4
cabal-hie-install data In general, executing targets with Multiple versions of HIE (optional)If you installed multiple versions of HIE then you will need to use a wrapper script. Wrapper script will analyze your project, find suitable version of HIE and launch it. Enable it by editing VS Code settings like this: "haskell.useCustomHieWrapper": true,
"haskell.useCustomHieWrapperPath": "hie-wrapper", ConfigurationThere are some settings that can be configured via a
Project ConfigurationFor a full explanation of possible configurations, refer to hie-bios/README. HIE will attempt to automatically detect your project configuration and set up the environment for GHC.
However, you can also place a cradle:
stack:
component: "haskell-ide-engine:lib" If you use cradle:
cabal:
component: "lib:haskell-ide-engine" If you have a project with multiple components, you can use a cabal-multi cradle: cradle:
cabal:
- path: "./test/dispatcher/"
component: "test:dispatcher-test"
- path: "./test/functional/"
component: "test:func-test"
- path: "./test/unit/"
component: "test:unit-test"
- path: "./hie-plugin-api/"
component: "lib:hie-plugin-api"
- path: "./app/MainHie.hs"
component: "exe:hie"
- path: "./app/HieWrapper.hs"
component: "exe:hie-wrapper"
- path: "./"
component: "lib:haskell-ide-engine" Equivalently, you can use stack: cradle:
stack:
- path: "./test/dispatcher/"
component: "haskell-ide-engine:test:dispatcher-test"
- path: "./test/functional/"
component: "haskell-ide-engine:test:func-test"
- path: "./test/unit/"
component: "haskell-ide-engine:test:unit-test"
- path: "./hie-plugin-api/"
component: "hie-plugin-api:lib"
- path: "./app/MainHie.hs"
component: "haskell-ide-engine:exe:hie"
- path: "./app/HieWrapper.hs"
component: "haskell-ide-engine:exe:hie-wrapper"
- path: "./"
component: "haskell-ide-engine:lib" Or you can explicitly state the program which should be used to collect the options by supplying the path to the program. It is interpreted relative to the current working directory if it is not an absolute path. cradle:
bios:
program: ".hie-bios" The complete configuration is a subset of cradle:
cabal:
component: "optional component name"
stack:
component: "optional component name"
bios:
program: "program to run"
dependency-program: "optional program to run"
direct:
arguments: ["list","of","ghc","arguments"]
default:
none:
dependencies:
- someDep There is also support for multiple cradles in a single cradle:
multi:
- path: ./test/dispatcher/
config:
cradle:
cabal:
component: "test:dispatcher-test"
- path: ./test/functional/
config:
cradle:
cabal:
component: "test:func-test"
- path: ./test/unit/
config:
cradle:
cabal:
component: "test:unit-test"
- path: ./hie-plugin-api/
config:
cradle:
cabal:
component: "lib:hie-plugin-api"
- path: ./app/MainHie.hs
config:
cradle:
cabal:
component: "exe:hie"
- path: ./app/HieWrapper.hs
config:
cradle:
cabal:
component: "exe:hie-wrapper"
- path: ./
config:
cradle:
cabal:
component: "lib:haskell-ide-engine" Editor IntegrationNote to editor integrators: there is now a All of the editor integrations assume that you have already installed HIE (see above) and that Using HIE with VS CodeInstall from the VSCode marketplace, or manually from the repository vscode-hie-server. Using VS Code with Nix
with import <nixpkgs> {};
let
hie = (import (fetchFromGitHub {
owner="domenkozar";
repo="hie-nix";
rev="e3113da";
sha256="05rkzjvzywsg66iafm84xgjlkf27yfbagrdcb8sc9fd59hrzyiqk";
}) {}).hie84;
in
{
allowUnfree = true;
packageOverrides = pkgs: rec {
vscode = pkgs.vscode.overrideDerivation (old: {
postFixup = ''
wrapProgram $out/bin/code --prefix PATH : ${lib.makeBinPath [hie]}
'';
});
};
} Using HIE with Sublime Text
Now open a Haskell project with Sublime Text. You should have these features available to you:
Using HIE with Vim or NeovimAs above, make sure HIE is installed. Then you can use Coc, LanguageClient-neovim or any other vim Langauge server protocol client. Coc is recommend since it is the only complete LSP implementation for Vim and Neovim and offers snippets and floating documentation out of the box. CocFollow Coc's installation instructions,
Then issue 全部评论
专题导读
上一篇:HaskVan/HaskellKoans: Haskell Koans for the Vancouver's Haskell UnMeetup发布时间:2022-06-18下一篇:sdiehl/write-you-a-haskell: Building a modern functional compiler from first pri ...发布时间:2022-06-18热门推荐
热门话题
阅读排行榜
|
请发表评论