Skip to content

VSCode extension for running and testing Competitive Programming solutions

License

Notifications You must be signed in to change notification settings

openhoangnc/vscode-io-run

Repository files navigation

IO Run

Marketplace Version Installs Rating Build Status

Support tool for running and testing your Competitive Programming solutions in multiple programming languages i.e C, C++, D, Dart, Go, Groovy, Haskell, Java, JavaScript, Kotlin, Lua, OCaml, Pascal, Perl, PHP, Python, R, Ruby, Rust, Scala, Swift

Donation

Eat to live, live to code

Features

  • Run code file
  • Run in Terminal
  • Run with multiple input files
  • Compare output files with accepted output files
  • Trace run time error by gdb or lldb
  • Cleanup after run

Usages

  • In the Text Editor, use shortcut Ctrl+Enter (Cmd+Enter) or right click the Text Editor and then click IORun Run in editor context menu, or click RunIcon button in editor title menu, the code will be run.
    • If there is no input file, the code will be run in TERMINAL.
    • If there are one or more input files, the code will be run with each input files. Input file will be redirect to Standard Input, the Standard Output will be redirect to output file.
  • To stop the running code, use shortcut Shift+Enter or right click the Output Channel and then click IORun Stop in context menu.

Usage

Configuration

Make sure the executor PATH of each language is set in the environment variable. You could also add entry into

  • io-run.executorMap.common (Common/Linux)
  • or io-run.executorMap.darwin (MacOS)
  • or io-run.executorMap.win32 (Windows)

to set the compile/run/cleanup command of your executor.

e.g. To set the executor PATH for C++, Java and Python:

"io-run.executorMap.common": {
    ".cpp": {
      "compileCmd": "g++ -g -O2 -std=gnu++11 -Wfatal-errors ${codeFile} -o ${codeFileNoExt}",
      "runCmd": "${dirCodeFileNoExt} <${inputFile} >${outputFile}",
      "cleanupCmd": "rm ${codeFileNoExt}",
      "errorTracer": "gdb"
    },
    ".java": {
      "compileCmd": "javac -encoding UTF-8 ${codeFile}",
      "runCmd": "java ${codeFileNoExt} <${inputFile} >${outputFile}",
      "cleanupCmd": "rm ${codeFileNoExt.class}"
    },
    ".py": {
      "runCmd": "python ${codeFile} <${inputFile} >${outputFile}"
    }
}

Supported customized parameters

  • $dir: The directory of the code file being run
  • $dirCodeFile: The full name of the code file being run
  • $dirCodeFileNoExt: The full name of the code file being run without its extension
  • $codeFile: The base name of the code file being run, that is the file without the directory
  • $codeFileNoExt: The base name of the code file being run without its extension

Please take care of the back slash and the space in file path of the executor

  • Back slash: please use \\

Note

Telemetry data

By default, telemetry data collection is turned on to understand user behavior to improve this extension. To disable it, update the settings.json as below:

{
    "io-run.enableAnalytics": false
}

Change Log

See Change Log here

Issues

Submit the issues if you find any bug or have any suggestion.

Contribution

Fork the repo and submit pull requests.

About

VSCode extension for running and testing Competitive Programming solutions

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •