Git Product home page Git Product logo

lsp-haskell's Introduction

lsp-haskell

MELPA

An Emacs Lisp library for interacting with a haskell-ide-engine server using Microsoft's Language Server Protocol.

The library is designed to integrate with existing Emacs IDE frameworks (completion-at-point, xref (beginning with Emacs 25.1), flycheck, haskell-mode, intero, etc).

This package is still under development, and is not recommended for daily use.

Emacs Configuration

Install lsp-mode first, and either clone this repository, or install from MELPA. Add the following to your .emacs:

(require 'lsp)
(require 'lsp-haskell)
(add-hook 'haskell-mode-hook #'lsp)

Note: All three packages are also available via MELPA.

It needs the HIE server in your path, so follow the appropriate OSX or Linux section below accordingly.

Hie Installation (OSX)

The following steps are recommended to bootstrap lsp-haskell on OSX.

git clone https://github.com/haskell/haskell-ide-engine
cd haskell-ide-engine
make

We need to run make here instead of stack install to ensure that all versions of ghc are available to support various project requirements.

After this, we need to instruct Emacs to prefer hie-wrapper over hie so Hie can infer which version of ghc we need for a particular project.

(setq lsp-haskell-process-path-hie "hie-wrapper")

Hie Installation (Linux)

Or of you are on linux (only place it has been tested, reports please)

git clone https://github.com/haskell/haskell-ide-engine
cd haskell-ide-engine
make

This will build executables called hie-8.0.2, hie-8.2.2 etc which can be selected by usingM-x customize for lsp-haskell

Per project configuration

HIE has some settings that can be changed on the fly. These are exposed via a set of interactive functions.

  • lsp-haskell-set-hlint-on / lsp-haskell-set-hlint-off Turn hlint checks on or off.
  • lsp-haskell-set-max-number-of-problems Set the maximum number of diagnostics reported.
  • lsp-haskell-set-liquid-on / lsp-haskell-set-liquid-off Turn liquid haskell checks on save on or off.
  • lsp-haskell-set-completion-snippets-on / lsp-haskell-set-completion-snippets-off Whether completion should return plain text or snippets.

There are also non-interactive versions that do not actually send the settings to the live server, but are suitable for use in .dir-locals for a specific project.

  • lsp-haskell-set-hlint
  • lsp-haskell-set-max-problems
  • lsp-haskell-set-liquid
  • lsp-haskell-set-completion-snippets

lsp-haskell's People

Contributors

alanz avatar maskray avatar serhiip avatar thkoch2001 avatar vibhavp avatar wpcarro avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.