Git Product home page Git Product logo

ocaml-scala-run's Introduction

Functionality

This extension lets you run OCaml (.ml) and Scala (.scala, .sc) files in REPL with a single button.

To evaluate the current file use the "Run in REPL" button located in the left half of the status bar, or use the "Run in REPL" command from the command palette (Ctrl+Shift+P). You can also set up a keyboard shortcut, by typing "Run in REPL" into the command palette and clicking the cog on the right of the command.

Only saved files can be run, and the extension runs the last known saved version of the file.

Details

The extension uses your default VS Code terminal and expects ocaml and/or scala commands to be available in it. It is compatible with WSL, running files from /mnt/c instead of c:. It uses following commands to run the files:

  • OCaml: ocaml, then #use "$filename";;
  • Scala: scala, then :load $filename

The extension creates terminal tabs called ocaml and scala respectively to run those commands.

Limitations

Due to limitations in terms of how VS Code extensions can affect the build-in terminal, the extension has no way of reading the output of a command or locking the terminal tabs. Which specifically means that if you exit the OCaml/Scala REPL in their respective tabs the run button will stop working (as it would try to use #use/:load directly in the terminal). In that case, close the terminal tab and it will reopen correctly on the next button click or command usage. It means that you are advised not to use terminal tabs created by the extension in any way other than reading their content.

ocaml-scala-run's People

Contributors

tchojnacki avatar

Watchers

 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.