Git Product home page Git Product logo

vscode-ide-purescript's Introduction

ide-purescript package for VS Code

This package provides editor support for PureScript projects in Visual Studio Code, similar to the corresponding atom plugin. Now based on a common PureScript language server! Basic syntax highlighting support is provided by the separate package language-purescript which should be installed automatically as a dependency.

This package provides:

  • Build and error reporting
  • Quick-fix support for certain warnings
  • Autocompletion
  • Type info tooltips
  • Go to symbol
  • Go to definition

Package should trigger on opening a .purs file.

Installation and General Use

This package makes use of the purs ide server (previously psc-ide) for most functionality, with purs compile (by default via pulp) for the explicit build command. All this is via a Language Server Protocol implementation, purescript-language-server.

This package will launch a purescript-language-server process, which will automatically (but this is configurable) start purs ide server in your project directory and kill it when closing. Start/stop and restart commands are provided for the IDE server in case required (eg after changing config or updating compiler version).

Multi-root workspaces should be supported via a multiple language server approach.

For all functions provided by the IDE server you will need to build your project first!

The extension language-purescript is required but should be installed automatically. The package will start on opening a .purs file.

Suggested extensions

See input-assist for Unicode input assistance on autocomplete which is known to work with this extension, alternatively unicode-latex which offers similar LaTeX based input vi a lookup command.

Key bindings

The only key binding supplied out of the box is Shift+Ctrl+B (or Shift+Cmd+B) for the full "Build" command. Although this is only enabled inside PureScript-language text editors, it does conflict with the built-in Build command. This can be edited, and other keybinds added, in the VS Code Keyboard Shortcuts preferences.

Build

With Pulp (default)

'PureScript Build' command will build your project using the command line pulp build -- --json-errors. Version 0.8.0+ of the PureScript compiler is required, as well as version 10.0.0 of pulp (with earlier versions remove --).

For pulp with psc-package, add the following configuration to your settings.json:

{
  "purescript.addNpmPath": true,
  "purescript.buildCommand": "pulp --psc-package build -- --json-errors"
}

With Spago

For spago with psc-package, add the following configuration to your settings.json:

{
  "purescript.addSpagoSources": true,
  "purescript.addNpmPath": true,
  "purescript.buildCommand": "spago build -- --json-errors"
}

Be sure to Restart/Reconnect purs IDE server following such changes.

Error suggestions are provided for some compiler errors, try alt/cmd and ..

Autocomplete

Provided from purs ide server. Make sure your project is built first.

Completions will be sourced from modules imported in the current file.

Tooltips

Hovering over an identifier will show a tooltip with its type.

This is really stupid, and only cares that you hover over a word regardless of context, you will get some false positives (eg doesn't see local definitions, just the globals that should be visible in a given module).

Hovering over a qualifier of a qualified identifier will show the associated module name.

Pursuit lookup

Commands "Search Pursuit" and "Search Pursuit Modules" are available to search for identifiers or modules/packages on Pursuit.

PSCI

No particular support. Suggest you open a PSCI in the integrated terminal.

vscode-ide-purescript's People

Contributors

andyarvanitis avatar devinrhode2 avatar hansel-no-kioku avatar justinwoo avatar krzysztof-cieslak avatar nwolverson avatar texastoland avatar

Watchers

 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.