Skip to content

Instantly share code, notes, and snippets.

@jonjack
Last active September 26, 2021 21:17
Show Gist options
  • Save jonjack/3b22374a0feae870ecc130eb5054714a to your computer and use it in GitHub Desktop.
Save jonjack/3b22374a0feae870ecc130eb5054714a to your computer and use it in GitHub Desktop.
Visual Studio code - command 'code-runner.run' not found fix for formulahendry.code-runner-0.9.10

Program: Visual Studio Code
Extension: Code Runner 0.9.10 (code-runner-0.9.10)
Problem: When attempting to run a script/program, VS Code reports error: "command 'code-runner.run'"
Fix: Manually edit extension code.

Edit extension file codeManager.js
On macOS this is usually at ~/.vscode/extensions/formulahendry.code-runner-0.9.10/out/src/codeManager.js

Comment out line 12.

11 const fs = require("fs");
12 // const micromatch = require("micromatch");
13 const os = require("os");

Comment out lines 225-236.

224 /*
225   if (executor == null) {
226         const executorMapByGlob = this._config.get("executorMapByGlob");
227         if (executorMapByGlob) {
228             const fileBasename = path_1.basename(this._document.fileName);
229             for (const glob of Object.keys(executorMapByGlob)) {
230                 if (micromatch.isMatch(fileBasename, glob)) {
231                     executor = executorMapByGlob[glob];
232                     break;
233                 }
234             }
235          }
236     }
237 */

Save changes and restart VS Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment