Skip to content

Commit 5ce17af

Browse files
tiansinformulahendry
authored andcommitted
Fix tempCodeRunnerFile.js not being deleted (#459)
* fix #441 #453 * add config showRunCommandInExplorerMenu * Fix showRunCommandInExplorerMenu
1 parent 1ea44a1 commit 5ce17af

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"group": "navigation"
8585
},
8686
{
87-
"when": "inOutput",
87+
"when": "inOutput && !config.code-runner.runInTerminal",
8888
"command": "code-runner.stop",
8989
"group": "stop-code-run"
9090
}
@@ -98,7 +98,7 @@
9898
],
9999
"explorer/context": [
100100
{
101-
"when": "!explorerResourceIsFolder",
101+
"when": "!explorerResourceIsFolder && config.code-runner.showRunCommandInExplorerMenu",
102102
"command": "code-runner.run",
103103
"group": "navigation"
104104
}
@@ -294,6 +294,12 @@
294294
"description": "Whether to show 'Run Code' command in editor context menu.",
295295
"scope": "resource"
296296
},
297+
"code-runner.showRunCommandInExplorerMenu": {
298+
"type": "boolean",
299+
"default": true,
300+
"description": "Whether to show 'Run Code' command in explorer context menu.",
301+
"scope": "resource"
302+
},
297303
"code-runner.temporaryFileName": {
298304
"type": "string",
299305
"default": "tempCodeRunnerFile",

src/codeManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ export class CodeManager implements vscode.Disposable {
478478
this._outputChannel.appendLine("");
479479
}
480480
if (this._isTmpFile) {
481-
fs.unlink(this._codeFile);
481+
fs.unlinkSync(this._codeFile);
482482
}
483483
});
484484
}

0 commit comments

Comments
 (0)