Giter Club home page Giter Club logo

haskelly's Introduction

Haskelly

Haskelly is a VS Code extension that provides complete support for casual and expert Haskell development. This includes:

  • Code highlight
  • Code snippets
  • Type hovers
  • Code completion
  • Running Haskell inside the editor using either GHCi, runHaskell or Stack build
  • Testing all the prop functions in a file with QuickCheck or Stack test

Features

Code highlight

Proper code highlight for Haskell code based on Haskell TextMate and for Cabal files thanks to Justus Adam.

Code snippets

Snippets for the most popular functions such as map or fold and other structures like data or newtype. For the tokens which have a snippets, Haskelly will show both the suggestion and the snippet. If you want to disable this behaviour and force Haskelly to only provide the snippet, set the configuration haskelly.snippets.important to true. Go to the [Extension Settings](## Extension Settings) section to learn how to add your own snippets.

Type hovers

Hover on top of an identifier and Haskelly will tell you what's its type.

hover

Code completion

Intelligent code completion which takes into account functions and constants defined in the opened file as well as the Haskell standard library and any imported modules.

completion

Running Haskell

The extension allows three ways of executing Haskell using the integrated terminal inside VS Code:

  • GHCi: you can call all the functions declared in the file providing the arguments. The extension calls stack ghci in the background.

  • Run file: looks for a main function and executes it. The extension uses stack runhaskell under the hood.

  • Stack run: runs the Stack project defined in the root folder. The extension runs stack run which uses the stack-run package.

bulding

Testing Haskell

Easily run QuickCheck on all the functions that start with the prefix prop_ in the currently opened file. If working in a Stack project, Haskelly will run stack test.

Demo

Watch a demo here.

Requirements

  • Stack. If you don't know about it, Stack is the best Haskell package manager. If you still use Cabal, check out Stack. After installing Stack and adding it to your PATH, run $ stack setup. This will install the GHC (Glasgow Haskell Compiler) and GHCi.

  • Stack packages (installed locally if working inside a Stack project):

    • Intero package for code completion. To install it globally: $ stack install intero or $ stack build intero if working on a Stack project.
    • QuickCheck package for running QuickCheck. To install it: $ stack install QuickCheck.
    • stack-run package for running stack run. To install it: $ stack install stack-run.

Extension Settings

Haskelly is fully customizable. Just add any of these properties in the preferences file (Code -> Preferences -> Workspace Settings (settings.json))

  • haskelly.codeCompletion: set to false to disable code completion
  • haskelly.buttons.ghci: set to false to hide the GHCi button in the bottom bar
  • haskelly.buttons.runfile: set to false to hide the Run file button in the bottom bar
  • haskelly.buttons.quickcheck: set to false to hide the QuickCheck button in the bottom bar
  • haskelly.buttons.stackRun: set to false to hide the Stack run button in the bottom bar
  • haskelly.buttons.stackTest: set to false to hide the Stack test button in the bottom bar
  • haskelly.snippets.important set to true to hide code completion for which there's a snippet.
  • haskelly.snippets.custom add your custom snippets following the structure of this file.

Road map

Check out the next features and development of Haskelly in this public board.

Contributing

If you'd like to contribute to Haskelly, this is what you can do:

  • Bugs: This extension is in alpha, so some bugs might be present. We would really appreciate if you could post any issue on the Github repository issues section or contact us at: [email protected].
  • Ideas and feature requests: We want to get everyone's opinion on what we're building so feel free to use the two mentioned channels for any comment or suggestion.
  • Documentation: Found a typo or strangely worded sentences? Submit a PR!
  • Code: Contribute bug fixes, features or design changes.

Release notes

Check out the release notes here.

Intero

Haskelly uses the Intero package in order to provide code completion and type hovers.

License

GNU 3

haskelly's People

Contributors

dlorch avatar maaarcocr avatar martrik 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.