Giter Site home page Giter Site logo

vscode-extempore's Introduction

vscode-extempore

An Extempore language extension for Visual Studio Code.

Installation

Install it through the Extensions view (View > Extensions).

Use

  1. open up an Extempore file (with an .xtm) file extension.
  2. start Extempore with Extempore Start (use the Command Palette)
  3. connect VSCode to the Extempore process with Extempore Connect
  4. move your cursor into an Extempore expression and evaluate it with Extempore Eval (default keybinding: ctrl+enter on Win/Linux, cmd+enter on macOS)

Configuration

Keybindings

Only Extempore Eval has a keybinding by default---although you should obviously feel free to add your own keybindings for other commands.

Extempore share directory

The extempore "share directory" is just your extempore folder---the one with libs, examples, runtime etc. For Extempore Start to be able to automatically start Extempore in a new terminal, it needs to know where this folder is. It tries to figure this out by:

  • if you've added a user setting for extempore.sharedir then it'll use that path

  • if you opened the root extempore folder as your workspace folder in VSCode (e.g. if you're just messing with the examples) then it'll use that

  • otherwise, it gives up and bombs out (you can still start extempore however you like, it's just that Extempore Start won't do it for you automagically)

If you're planning on doing a lot of Extempore coding, it's not a bad idea to set that in your user settings. Open your user settings with Preferences: Open User Settings and add a config entry which looks like this:

  "extempore.sharedir": "/Users/ben/extempore" 

Don't forget to replace /Users/ben/extempore (or C:\Users\ben\extempore or whatever) with the path to the extempore folder on your machine. Also, make sure your user settings file is still valid JSON after you've made your edits.

Features

  • start & manage Extempore processes using the built-in terminal
  • Syntax highlighting
  • Auto-indent on return
  • Snippets: two example snippets are provided (tr: temporal recursion bf: bind-func)

TODO

  • allow for multiple simultaneous connections (on different host/port)
  • more snippets
  • play nice with paredit/parinfer/other fancy editing tools

Changelog

  • 0.0.1: initial release

  • 0.0.2: prompt for host/port

  • 0.0.3: add Extempore Start, send selected region (if selection is active)

  • 0.0.4: top-level eval, pretty blinking on eval, sharedir stuff

  • 0.0.5:

    • improved formatting (sets editor.formatOnType: true by default)
    • use EXTEMPORE_PATH env var if set
    • add Extempore Help command to jump to docs website
    • plays nicer with paredit/parinfer
  • 0.0.6: more robust top-level eval (ignores brackets in strings/comments)

  • 0.0.7: more robust top-level evel

  • 0.0.8: actually robust top-level eval (honestly ;)

  • 0.0.9:

    • fixed some indenting problems
    • added selection formatting
    • added snippets for play, mplay, loop, eloop, mloop, mcc

Developer Notes

To work on this VSCode extension (any help is appreciated!) you need to:

  1. install the deps with npm install
  2. activate the extension
  3. make it better
  4. submit a pull request

Licence

MIT

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.