jsonvisual-studio-codevscode-code-runnercoderunner

CodeRunner extension Visual Studio: Not showing in Output


Trying to get Script output to show in output tab using code runner extension. Was previously working but tinkered around to see if I could trouble shoot a script in terminal. Now unable to revert.

JSON Settings for Visual Studio Setup:

{
  "workbench.colorTheme": "Visual Studio Dark",
  "workbench.startupEditor": "none",
  "debug.console.fontSize": 24,
  "markdown.preview.fontSize": 24,
  "scm.inputFontSize": 24,
  "editor.fontSize": 24,
  "terminal.integrated.fontSize": 12,
  "editor.mouseWheelZoom": true,
  "workbench.settings.openDefaultSettings": true,
  "telemetry.enableTelemetry": false,
  "telemetry.enableCrashReporter": false,
  "editor.accessibilitySupport": "off",

  // CODE RUNNER SETTINGS
  "code-runner.clearPreviousOutput": true,
  "code-runner.ignoreSelection": true,
  "code-runner.saveAllFilesBeforeRun": false,
  "code-runner.saveFileBeforeRun": true,
  "code-runner.showExecutionMessage": false,
  "code-runner.executorMap": {
    "python": "python3 -u"
  }
}

Code Runner Extension has been reinstalled a number of times however I am unable to get the output of the script to run in the output tab. Instead it is showing in Terminal despite specifying to not do this.

enter image description here

One thing I have noticed is that changes dont seem to be taking affect without restarting visual studio...

However even on restart with this issue nothing changes.


Solution

  • Hardly a solution (more like turn it on and off again) and most likely overkill but here's what I did:

      rm -rf ~/.vscode*
      rm -rf ~/Library/Application\ Support/Code
      rm -rf ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState
      rm -rf ~/Library/Preferences/com.microsoft.VSCode.helper.plist 
      rm -rf ~/Library/Preferences/com.microsoft.VSCode.plist 
      rm -rf ~/Library/Caches/com.microsoft.VSCode
      rm -rf ~/Library/Caches/com.microsoft.VSCode.ShipIt
      sudo rm -rf /Applications/Visual\ Studio\ Code.app
    

    Reinstalled VScode and Code Runner.

    The instead of messing with JSON directly. Just used default checkboxes

    enter image description here

    JSON output of this:

    Note you may wish to change python to:

      "python": "$pythonPath -u $fullFileName",
    

    to enable automatic selection

    {
        "code-runner.executorMap": {
    
            "javascript": "node",
            "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
            "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
            "zig": "zig run",
            "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
            "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
            "php": "php",
            "python": "python3 -u",
            "perl": "perl",
            "perl6": "perl6",
            "ruby": "ruby",
            "go": "go run",
            "lua": "lua",
            "groovy": "groovy",
            "powershell": "powershell -ExecutionPolicy ByPass -File",
            "bat": "cmd /c",
            "shellscript": "bash",
            "fsharp": "fsi",
            "csharp": "scriptcs",
            "vbscript": "cscript //Nologo",
            "typescript": "ts-node",
            "coffeescript": "coffee",
            "scala": "scala",
            "swift": "swift",
            "julia": "julia",
            "crystal": "crystal",
            "ocaml": "ocaml",
            "r": "Rscript",
            "applescript": "osascript",
            "clojure": "lein exec",
            "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
            "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
            "racket": "racket",
            "scheme": "csi -script",
            "ahk": "autohotkey",
            "autoit": "autoit3",
            "dart": "dart",
            "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
            "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
            "haskell": "runghc",
            "nim": "nim compile --verbosity:0 --hints:off --run",
            "lisp": "sbcl --script",
            "kit": "kitc --run",
            "v": "v run",
            "sass": "sass --style expanded",
            "scss": "scss --style expanded",
            "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css",
            "FortranFreeForm": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
            "fortran-modern": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
            "fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
            "fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
            "sml": "cd $dir && sml $fileName",
            "mojo": "mojo run",
            "erlang": "escript",
            "spwn": "spwn build",
            "pkl": "cd $dir && pkl eval -f yaml $fileName -o $fileNameWithoutExt.yaml",
            "gleam": "gleam run -m $fileNameWithoutExt"
        },
        "code-runner.clearPreviousOutput": true,
        "code-runner.showExecutionMessage": false,
        "code-runner.saveFileBeforeRun": true
    }