Skip to content

mneedham/venkat

Repository files navigation

venkat

This is the README for the VS Code extension "venkat".

It runs the example file up to the current line (or the selection) and displays the result of that last line in a comment after or for multi-line results below (or as info message).

It is inspired by Venkat Subramaniam's use of Textmate tooltips for code execution results which is great for presentations.

Features

  • execute selection or code up to current line
  • Language support for python, javascript, typescript, ruby, java, kotlin
  • supports multiline outputs
  • selects result, so can be deleted or copied with a single keystroke
  • show result as comment or as info message
  • configurable extra languages

Requirements

An interpreter for the languages used, should be installed.

  • python: python
  • javascript : node
  • ruby: ruby
  • java: jshell -s
  • kotlin: kotlin
  • typescript: ts-node
  • php: php -f

Configuration

  • resultAsComment : boolean, default true - insert the result as comments, otherwise show them as info message

  • languages : structure for languages with entries for extension, comment, executable, output, exit, where output contains a ${expression} placeholder, and exit optionally contains code to end the script execution.

Here are two examples:

    "venkat.languages": {
        "python": {
            "comment": "#",
            "executable": "python",
            "extension": "py",
            "output": "print(${expression})"
        },
        "java": {
            "comment": "//",
            "executable": "jshell -s ",
            "extension": "java",
            "output": "System.out.println(${expression});",
            "exit": "/exit"
        }
    }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published