{"id":13441894,"url":"https://github.com/formulahendry/vscode-code-runner","last_synced_at":"2025-05-15T01:08:40.722Z","repository":{"id":37534295,"uuid":"63349839","full_name":"formulahendry/vscode-code-runner","owner":"formulahendry","description":"Code Runner for Visual Studio Code","archived":false,"fork":false,"pushed_at":"2024-08-11T01:38:16.000Z","size":1247,"stargazers_count":2287,"open_issues_count":708,"forks_count":308,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-04-11T14:16:52.423Z","etag":null,"topics":["executor","runner","typescript","visual-studio-code","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/formulahendry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-14T15:52:10.000Z","updated_at":"2025-04-10T14:52:37.000Z","dependencies_parsed_at":"2024-01-14T16:08:07.312Z","dependency_job_id":"df9f73f6-71b6-4ab1-be31-e93633316cb1","html_url":"https://github.com/formulahendry/vscode-code-runner","commit_stats":{"total_commits":205,"total_committers":41,"mean_commits":5.0,"dds":0.2634146341463415,"last_synced_commit":"97af1080d09046e0129acce592f0033ff2df9f26"},"previous_names":[],"tags_count":83,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fvscode-code-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fvscode-code-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fvscode-code-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formulahendry%2Fvscode-code-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formulahendry","download_url":"https://codeload.github.com/formulahendry/vscode-code-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254042,"owners_count":22039792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["executor","runner","typescript","visual-studio-code","vscode","vscode-extension"],"created_at":"2024-07-31T03:01:39.359Z","updated_at":"2025-05-15T01:08:35.705Z","avatar_url":"https://github.com/formulahendry.png","language":"TypeScript","readme":"# Code Runner\n\n[![Join the chat at https://gitter.im/formulahendry/vscode-code-runner](https://badges.gitter.im/formulahendry/vscode-code-runner.svg)](https://gitter.im/formulahendry/vscode-code-runner?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) ![Downloads](https://img.shields.io/visual-studio-marketplace/d/formulahendry.code-runner) ![Rating](https://img.shields.io/visual-studio-marketplace/r/formulahendry.code-runner) [![Actions Status](https://github.com/formulahendry/vscode-code-runner/actions/workflows/main.yml/badge.svg)](https://github.com/formulahendry/vscode-code-runner/actions/workflows/main.yml)\n\nRun code snippet or code file for multiple languages: **C, C++, Java, JavaScript, PHP, Python, Perl, Perl 6, Ruby, Go, Lua, Groovy, PowerShell, BAT/CMD, BASH/SH, F# Script, F# (.NET Core), C# Script, C# (.NET Core), VBScript, TypeScript, CoffeeScript, Scala, Swift, Julia, Crystal, OCaml Script, R, AppleScript, Elixir, Visual Basic .NET, Clojure, Haxe, Objective-C, Rust, Racket, Scheme, AutoHotkey, AutoIt, Kotlin, Dart, Free Pascal, Haskell, Nim, D, Lisp, Kit, V, SCSS, Sass, CUDA, Less, Fortran, Ring, Standard ML, Zig, Mojo, Erlang, SPWN, Pkl, Gleam**, and custom command\n\n## Book for VS Code\n\n[《Visual Studio Code 权威指南》](https://union-click.jd.com/jdc?e=jdext-1261348777639735296-0\u0026p=AyIGZRhbHQsWAVIaXxEyEgRdG1sRBxU3EUQDS10iXhBeGlcJDBkNXg9JHUlSSkkFSRwSBF0bWxEHFRgMXgdIMkRxFAUJD1RQZT0cBnwKDE4%2BaDpgB2ILWStbHAIQD1QaWxIBIgdUGlsRBxEEUxprJQIXNwd1g6O0yqLkB4%2B%2FjcePwitaJQIWD1cfWhwKGwVSG1wlAhoDZc31gdeauIyr%2FsOovNLYq46cqca50ytrJQEiXABPElAeEgRSG1kQCxQBUxxZHQQQA1YTXAkDIgdUGlscChECXRs1FGwSD1UbWRALFwRWK1slASJZOxoLRlUXU1NONU9QEkdXWRlJbBUDVB9TFgAVN1caWhcA)：带你深入浅出 VS Code！\n\n![Book](images/book.jpg)\n\n## WeChat Official Account\n\nVS Code 的热门文章、使用技巧、插件推荐、插件开发攻略等，请关注“**玩转VS Code**”公众号！\n\n![WeChat](images/WeChatPublicAccount.jpg)\n\n## Donation\n\nIf you like this extension, you could become a backer or sponsor via **[Patreon](https://www.patreon.com/junhan)**, donate via **[PayPal](https://www.paypal.me/junhanme)**, or scan below QR code to donate via **Alipay**. Any amount is welcome. It will encourage me to make this extension better and better!\n\n![Alipay](images/alipay.png)\n\n## Features\n\n* Run code file of current active Text Editor\n* Run code file through context menu of file explorer\n* Run selected code snippet in Text Editor\n* Run code per Shebang\n* Run code per filename glob\n* Run custom command\n* Stop code running\n* View output in Output Window\n* Set default language to run\n* Select language to run\n* Support REPL by running code in Integrated Terminal\n\n## Usages\n\n* To run code:\n  * use shortcut `Ctrl+Alt+N`\n  * or press `F1` and then select/type `Run Code`, \n  * or right click the Text Editor and then click `Run Code` in editor context menu\n  * or click `Run Code` button in editor title menu\n  * or click `Run Code` button in context menu of file explorer\n* To stop the running code:\n  * use shortcut `Ctrl+Alt+M`\n  * or press `F1` and then select/type `Stop Code Run`\n  * or click `Stop Code Run` button in editor title menu\n  * or right click the Output Channel and then click `Stop Code Run` in context menu\n\n![Usage](images/usage.gif)\n\n* To select language to run, use shortcut `Ctrl+Alt+J`, or press `F1` and then select/type `Run By Language`, then type or select the language to run: e.g `php, javascript, bat, shellscript...`\n\n![Usage](images/usageRunByLanguage.gif)\n\n* To run custom command, then use shortcut `Ctrl+Alt+K`, or press `F1` and then select/type `Run Custom Command`\n\n## Configuration\n\nMake sure the executor PATH of each language is set in the environment variable.\nYou could also add entry into `code-runner.executorMap` to set the executor PATH.\ne.g. To set the executor PATH for ruby, php and html:\n```json\n{\n    \"code-runner.executorMap\": {\n        \"javascript\": \"node\",\n        \"php\": \"C:\\\\php\\\\php.exe\",\n        \"python\": \"python\",\n        \"perl\": \"perl\",\n        \"ruby\": \"C:\\\\Ruby23-x64\\\\bin\\\\ruby.exe\",\n        \"go\": \"go run\",\n        \"html\": \"\\\"C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\\\"\",\n        \"java\": \"cd $dir \u0026\u0026 javac $fileName \u0026\u0026 java $fileNameWithoutExt\",\n        \"c\": \"cd $dir \u0026\u0026 gcc $fileName -o $fileNameWithoutExt \u0026\u0026 $dir$fileNameWithoutExt\"\n    }\n}\n```\n**Supported customized parameters**\n  * $workspaceRoot: The path of the folder opened in VS Code\n  * $dir: The directory of the code file being run\n  * $dirWithoutTrailingSlash: The directory of the code file being run without a trailing slash\n  * $fullFileName: The full name of the code file being run\n  * $fileName: The base name of the code file being run, that is the file without the directory\n  * $fileNameWithoutExt: The base name of the code file being run without its extension\n  * $driveLetter: The drive letter of the code file being run (Windows only)\n  * $pythonPath: The path of Python interpreter (set by `Python: Select Interpreter` command)\n\n**Please take care of the back slash and the space in file path of the executor**\n  * Back slash: please use `\\\\`\n  * If there ares spaces in file path, please use `\\\"` to surround your file path\n\nYou could set the executor per filename [glob](https://en.wikipedia.org/wiki/Glob_(programming)):\n```json\n{\n    \"code-runner.executorMapByGlob\": {\n        \"pom.xml\": \"cd $dir \u0026\u0026 mvn clean package\",\n        \"*.test.js\": \"tap\",\n        \"*.js\": \"node\"\n    }\n}\n```\n\nBesides, you could set the default language to run:\n```json\n{\n    \"code-runner.defaultLanguage\": \"javascript\"\n}\n```\n**For the default language:** It should be set with language id defined in [VS Code](https://github.com/Microsoft/vscode/tree/master/extensions). The languages you could set are `java, c, cpp, javascript, php, python, perl, ruby, go, lua, groovy, powershell, bat, shellscript, fsharp, csharp, vbscript, typescript, coffeescript, swift, r, clojure, haxe, objective-c, rust, racket, ahk, autoit, kotlin, dart, pascal, haskell, nim, d, lisp`\n\nAlso, you could set the executor per file extension:\n```json\n{\n    \"code-runner.executorMapByFileExtension\": {\n        \".vbs\": \"cscript //Nologo\"\n    }\n}\n```\n\nTo set the custom command to run:\n```json\n{\n    \"code-runner.customCommand\": \"echo Hello\"\n}\n```\n\nTo set the the working directory:\n```json\n{\n    \"code-runner.cwd\": \"path/to/working/directory\"\n}\n```\n\nTo set whether to clear previous output before each run (default is false):\n```json\n{\n    \"code-runner.clearPreviousOutput\": false\n}\n```\n\nTo set whether to save all files before running (default is false):\n```json\n{\n    \"code-runner.saveAllFilesBeforeRun\": false\n}\n```\n\nTo set whether to save the current file before running (default is false):\n```json\n{\n    \"code-runner.saveFileBeforeRun\": false\n}\n```\n\nTo set whether to show extra execution message like [Running] ... and [Done] ... (default is true):\n```json\n{\n    \"code-runner.showExecutionMessage\": true\n}\n```\n\n**[REPL support]** To set whether to run code in Integrated Terminal (only support to run whole file in Integrated Terminal, neither untitled file nor code snippet) (default is false):\n```json\n{\n    \"code-runner.runInTerminal\": false\n}\n```\n\nTo set whether to preserve focus on code editor after code run is triggered (default is true, the code editor will keep focus; when it is false, Terminal or Output Channel will take focus):\n```json\n{\n    \"code-runner.preserveFocus\": true\n}\n```\n\n`code-runner.ignoreSelection`: Whether to ignore selection to always run entire file. (Default is **false**)\n\n`code-runner.showRunIconInEditorTitleMenu`: Whether to show 'Run Code' icon in editor title menu. (Default is **true**)\n\n`code-runner.showRunCommandInEditorContextMenu`: Whether to show 'Run Code' command in editor context menu. (Default is **true**)\n\n`code-runner.showRunCommandInExplorerContextMenu`: Whether to show 'Run Code' command in explorer context menu. (Default is **true**)\n\n`code-runner.showStopIconInEditorTitleMenu`: Whether to show 'Stop Code Run' icon in editor title menu when code is running. (Default is **true**)\n\n`code-runner.terminalRoot`: For Windows system, replaces the Windows style drive letter in the command with a Unix style root when using a custom shell as the terminal, like Bash or Cgywin. Example: Setting this to `/mnt/` will replace `C:\\path` with `/mnt/c/path` (Default is **\"\"**)\n\n`code-runner.temporaryFileName`: Temporary file name used in running selected code snippet. When it is set as empty, the file name will be random. (Default is **\"tempCodeRunnerFile\"**)\n\n`code-runner.respectShebang`: Whether to respect Shebang to run code. (Default is **true**)\n\n## About CWD Setting (current working directory)\n1. By default, use the `code-runner.cwd` setting\n2. If `code-runner.cwd` is not set and `code-runner.fileDirectoryAsCwd` is `true`, use the directory of the file to be executed\n3. If `code-runner.cwd` is not set and `code-runner.fileDirectoryAsCwd` is `false`, use the path of root folder that is open in VS Code\n4. If no folder is open, use the os temp folder\n\n## Note\n* For Objective-C, it is only supported on macOS\n* To run C# script, you need to install [scriptcs](http://scriptcs.net/)\n* To run TypeScript, you need to install [ts-node](https://github.com/TypeStrong/ts-node)\n* To run Clojure, you need to install [Leiningen](https://leiningen.org/) and [lein-exec](https://github.com/kumarshantanu/lein-exec)\n\n## Telemetry data\nBy default, telemetry data collection is turned on to understand user behavior to improve this extension. To disable it, update the settings.json as below:\n```json\n{\n    \"code-runner.enableAppInsights\": false\n}\n```\n\n## Change Log\nSee Change Log [here](CHANGELOG.md)\n\n## Issues\nSubmit the [issues](https://github.com/formulahendry/vscode-code-runner/issues) if you find any bug or have any suggestion.\n\n## Contribution\nFork the [repo](https://github.com/formulahendry/vscode-code-runner) and submit pull requests.\n","funding_links":["https://www.patreon.com/junhan)*","https://www.paypal.me/junhanme)*"],"categories":["HarmonyOS","TypeScript","vscode-extension"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformulahendry%2Fvscode-code-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformulahendry%2Fvscode-code-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformulahendry%2Fvscode-code-runner/lists"}