Haskell Ghc-mod Visual Studio Code For Mac?

A larger user base means more users that can potentially contribute to the project. Furthermore, Yi seems to lack the killing-features that would attract users that are using other editors. I'm trying to set up a Haskell IDE with Atom on mac. I install the binaries with stack and make sure the right paths are under 'Additional Path Directories', but get the following errors from GHC mod.

Studio

Linux, OS X:

ghc-mod language extension for VS Code.

Overview

The extension follows the client/server model for language extensions from the VS Code docs. The client is a normal VS Code extension and the server is a node program which runs in a seperate process. The two communicate through a connection object.

To properly run and debug the extension, the client and server directories should be opened in seperate instances of VS Code.

Prerequisites

The extension assumes ghc-mod is installed and on the system PATH OR is configured via haskell.ghc-mod.executablePath in user or workspace settings. I installed ghc-mod on windows via cabal using these instructions and it is working.New symbol support also assumes fast-tags or hasktags are installed in a similar manner to ghc-mod.

Running the extension

To get the application running, clone the whole repository and run npm install and npm run compile in both the client and server directories. Then open the client folder in an instance of VS Code and press F5 to start debugging. This will launch the extension in a new instance of VS Code called the extension host.

Debugging the extension

For

After running the extension as explained above, press F5 in a seperate instance of VS Code that has the server directory open. This will attach the debugger to the extension host.

Modifying the extension

Run npm run compile from the client and server directories depending on which files changed, or use the build tasks (from command palette or ctrl+shift+b) to start the build tasks in 'watch' mode which will build changes as files change.

Visual Studio

Testing the extension

Mocha test runner via npm

npm test from the server directory will run tests against the most recently compiled version of the code. The test command does NOT currently build the application.npm run tslint from the server and client directories will run tslint. tslint must pass for the build to pass.

Visual studio code download

Wallabyjs

This project includes a wallaby.js configuration file which should automatically work if the wallabyjs extension is installed. Simply open the server folder in VS Code and issue the start command to wallabyjs (ctrl+shift+R, R).

Server Components

There are three main components with distinct responsibilities. server.ts is responsible for all communication with VS Code and decides when to issue ghc-mod commands (i.e. check when documents change, info on hover, etc.). ghcMod.ts is a wrapper around the ghc-mod process running in interactive mode and handles reading and writing to the process vs stdin/stdout to issue commands and process output. It implements the IGhcMod interface. This allows it to be swapped out with a non-interactive implementation of IGhcMod. ghcModProvider.ts is the middleman and implements the IGhcModProvider interface which exposes the supported ghc-mod commands to server.ts via public methods such as getType and doCheck and issues properly formed commands to an object that implements IGhcMod.ts. It returns the results via promises.

Features

  • ghc-mod check
  • ghc-mod info
  • ghc-mod type
  • Go to definition
  • Insert type
  • Go to symbol
  • Show all symbols

Publishing

From the client directory:vsce publish --baseImagesUrl https://raw.githubusercontent.com/hoovercj/vscode-ghc-mod/master/client/

Next steps

  • Add new commands
  • Add completion backend

Node.js

Can I Introduce you to Haskelly team from University College London, System Engineering course.

Janos, Marco and Marti are three students, currently studying Computer Science at University College London. As part of their system engineering course they are undertaking a team based project. They have been working on a Visual Studio Code and Microsoft Azure Cloud project, to build a Visual Studio Code extension which supports the teaching and learning of Haskell.

Haskell is used widely in academia and also used in industry. But specifically many of the worlds Universities teach Haskell as the first FUNCTIONAL language. The opportunity with this extension and Azure really shows off the power of VSCode as the primary IDE on Windows, MacOS and Linux.

The team are developing an Azure hosted toolset entitled SEAT, SEAT Scaffolding Exercise Automation Toolkit provides a valuable teaching assistant to the Academics and TA in the evaluation of the Haskell learning from students. Students simply submit assignments and resources to the code validation engine assessing the students learning and competencies.

The Haskelly extension has been in development for the past 4 weeks and the team had a superbly impressive demo which shown the VS code Extension working intellisense code completion and quickcheck. The team successfully developed the extension and have made it available for FREE in the Visual Studio Marketplace https://marketplace.visualstudio.com/items?itemName=UCL.haskelly they have had over 2,000 downloads.

Last week the team and their academic supervisor, Dr Dean Mohamedally had the opportunity of meeting Simon Peyton Jones at Microsoft Research Cambridge. Simon is a major contributor to the design of the Haskell programming language, and a lead developer of the Glasgow Haskell Compiler (GHC).

Simon is also co-creator of the C-- programming language, designed for intermediate program representation between the language-specific front-end of a compiler and a general-purpose back-end code generator and optimiser. C-- is used in GHC. During the meeting Simon shared his experiences and insight with the team and they discussed potential new features for the extension.

Git

Haskelly Features

  • Syntax Highlighting
  • Code completion
  • Scripted Toolchain with Haskell's components (as programme or using GHCi)
  • QuickChecksupport

SEAT for UCL

  • AZURE Cloud Based
  • Cloud based allows classroom analysis
  • Students load encrypted file into VS Code
  • Automatic Checking for Students

The intention is that the SEAT toolset will be used within UCL Functional programming courses and provide a Cloud Based classroom analysis Students load encrypted file into VS Code Automatic Checking for Students code.

Plugin with piping architecture overview


Different approaches:

  • Running code: stack runhaskell in the integrated terminal
  • GHCi:running a JS file that pipes a process’s output to its own stdout and handles input
  • QuickQueck: using a spawn process and parsing the output to display feedback
  • Code completion: direct implementation using a dynamic spawn process

The intention is that SEAT Scaffolding Exercise Automation Tools will be used for all UCL students
Server-less programming

Code hosted in a repository -> automatic deployment

Haskell Ghc-mod Visual Studio Code For Mac Download

Azure Web App manages Authentication

Azure Functions run on– demand

So in summary VS Code makes it easy to develop plugins for education

Azure Web Apps setup with auto. deployment

Institutions running O365 and AAD can utilise Azure Authentication for professors and Students providing single sign on to the necessary resources.

How To Use Visual Studio Code For Python

If your interested in learning more about developing Visual Studio Extensions see
https://code.visualstudio.com/docs/extensions/overview
If you interested in understanding what extension are currently available see https://visualstudiogallery.msdn.microsoft.com/