GithubHelp home page GithubHelp logo

aymanosman / magic-racket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eugleo/magic-racket

0.0 2.0 0.0 3.06 MB

The best coding experience for Racket in VS Code

Home Page: https://marketplace.visualstudio.com/items?itemName=evzen-wybitul.magic-racket

License: GNU General Public License v3.0

TypeScript 93.40% JavaScript 6.60%

magic-racket's Introduction

Magic Racket for VS Code

This extension adds support for Racket to VS Code. With the newly added support for language server protocol, we're proud to say that Magic Racket is the best Racket extension for VS Code.

Setting up

  1. Install Magic Racket. You can do that from the VS Code extension marketplace.

  2. Install the racket-langserver by runnning the following command:

    raco pkg install racket-langserver

    Or update it using

    raco pkg update racket-langserver

Features

Magic Racket does

  • Support Racket LSP through racket-langserver, which brings jump to definition, hover information and more
  • Have nearly complete support for every valid Racket syntax: byte strings, regexps, define clauses, vectors... You name it, we have it
  • Support highlighting of all of the standart functions in #lang racket
  • Turn many little VS Code knobs and switches to provide you the best possible Racket-writing experience

...but at the same time doesn't:

  • Get in your way by providing useless snippets
  • Throw around colorization just for the sake of it
  • Try to do everything. What can be left up on the LSP, or some other package, will be. Focus is key

LSP Support

Magic Racket now supports racket-langserver. The current features are:

  • Underline errors
  • Jump to definition
  • Find references
  • Hover information

We're working on providing more details in this section: stay tuned!

Syntax highlighting

The image shows a comparison of a testing file highlighted using a popular Racket VS Code extension (on the left) and by Magic Racket (on the right).

Highlighting comparison

As you can see, Magic Racket strives to be correct and consistent — and it supports most of the language features as well. In many ways, this extension was inspired by the highlighting in DrRacket, however, in some aspects it aims to be less minimalistic.

REPL support

You can load and execute files in Magic Racket by using the icons in the top right corner of your editor (see the image below), or from the commands console in VS Code. You can open the list of all commands by pressing Cmd+Shift+P (or Ctrl+Shift+P if you're on Linux or Windows) and then search through them by typing. All of Magic Racket's commands are prefixed by Racket: to make the searching easier.

In Magic Racket, each file will have its own REPL in which it'll load everytime you use the Racket: Load file in REPL command. You can choose to mimic this behavior also for Racket: Run file in terminal, or you can run all files in one output terminal.

REPL showcase

The list of commands added by Magic Racket:

  • Racket: Execute selection in REPL
    • Executes the selection(s) in the REPL. Available also by right-clicking the selection or by using the shortcut Alt+Enter.
  • Racket: Load file in REPL
    • Loads the current file into its REPL, creating a new REPL in the process if the file doesn't have one yet. Does have its icon in the top right corner.
  • Racket: Run file in terminal
    • Runs the whole file in a terminal, outside of REPL environment. Depending on user settings, the terminal will be either shared among all files (default), or the one that belongs to the file.
  • Racket: Open the REPL for the current file
    • Shows the REPL belonging to the current file, or opens a new one if the file doesn't have one yet.
  • Racket: Show the output terminal for the current file
    • Similarly to the command above, this one shows the output terminal of the current file.

You can set the names of the REPLs and output terminals in the settings.

Minor QoL features

These aren't game-changers, but they certainly help.

  • You can write a λ (lambda) by using the included snippet lmb or the shortcut Cmd+/ (or Ctrl+/ on Windows and Linux)
    • If anybody knows how to bind it to Cmd+\, let me know
  • VS Code recognizes the "words" in Racket correctly, meaning that moving among words using Ctrl+Left and Ctrl+Right works as expected, and so does the double-click word selection

Release notes

Please see the changelog for the information about the latest updates.

Want to help us?

Firstly — that's great, thanks! Please see contributing for the information about what we need

magic-racket's People

Contributors

eugleo avatar jjpro avatar

Watchers

James Cloos 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.