Simple GHC (Haskell) integration for VSCode
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
.github Add issue template Jun 28, 2018
.vscode
images [meta] Put icon inside package Jul 6, 2018
src [conf][#4] Add several configuration options Jul 28, 2018
.gitignore First commit Jan 19, 2018
.vscodeignore
CHANGELOG.md Bump version to v0.0.10 and changelog update Sep 24, 2018
LICENSE
README.md [readme] Add rudimentary docs Sep 24, 2018
package-lock.json
package.json Bump version to v0.0.10 and changelog update Sep 24, 2018
tsconfig.json First commit Jan 19, 2018

README.md

Simple GHC (Haskell) Integration for VSCode

Icon

Simple Haskell support using only GHCi.

vscode-ghc-simple on Visual Studio Marketplace CircleCI

Installation

Get vscode-ghc-simple from the Visual Studio Marketplace or run the following in Quick Open:

ext install dramforever.vscode-ghc-simple

Alternatively, if you want the latest and greatest, you can download vsix files from Circle CI. Pick the latest build, and check out the 'Artifacts' tab.

What?

This VSCode extension provides editing enhancements for Haskell development.

Currently implemented features:

  1. Diagnostics: Basic squiggles and error messages. Automatic re-checking on save.

    Squiggle demo screenshot

  2. Completion: Crude completion with GHCi's :complete command, with :info lookup. Works okay with imported and top level identifiers.

    Completion demo screenshot

  3. Type: View types by selecting in the code. The minimal expression covering the selection will have its type shown. Implemented with :all-types.

    Range type demo screenshot

  4. Definition: See definitions of identifiers. Supports both module level and local identifiers. Implemented with :loc-at. Does not yet support identifiers imported from packages.

    Definition demo screenshot

Why?

Since around GHC 8, the compiler GHC and its interactive REPL GHCi has gained various tooling-related features. These allow for more tooling that communicate with the compiler using text IO and files, instead of a Haskell API. This project aims to explore the possibilities provided by said features, by implementing Haskell tooling within the editor VSCode.

Notes

Commands

  • vscode-ghc-simple.restart: Restart GHCi sessions

    vscode-ghc-simple currently lacks a way of detecting changes of critical configuration files such as stack.yaml or *.cabal. Run this command whenever, had you been running GHCi manually, you would restart it.

Configuration options

  • ghcSimple.workspaceType: Workspace type

    Override workspace type detection and force a certain workspace type (e.g. stack or cabal).

    Normally, vscode-ghc-simple will try to detect whether to use Stack or Cabal, or use a plain GHCi. Change this option in your workspace settings to specify such a type manually.

  • ghcSimple.startupCommands and ghcSimple.bareStartupCommands

    Commands to run at GHCi startup. Configures some common options.