From 2fb4d873dd1e6e161c39d4de4ad157601fb750a2 Mon Sep 17 00:00:00 2001 From: formulahendry Date: Tue, 13 Mar 2018 21:36:35 +0800 Subject: [PATCH] Bump version to 0.9.2 --- CHANGELOG.md | 3 +++ README.md | 1 + package.json | 2 +- src/codeManager.ts | 15 +++++++-------- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6952ce4..a3e15ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 0.9.2 (2018-03-13) +* Add $pythonPath customized parameter to respect `python.pythonPath` setting + ### 0.9.1 (2018-03-08) * Add option to respect Shebang or not diff --git a/README.md b/README.md index a7c4d99..662d376 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ e.g. To set the executor PATH for ruby, php and html: * $fileName: The base name of the code file being run, that is the file without the directory * $fileNameWithoutExt: The base name of the code file being run without its extension * $driveLetter: The drive letter of the code file being run (Windows only) + * $pythonPath: The path of Python interpreter (set by `Python: Select Interpreter` command) **Please take care of the back slash and the space in file path of the executor** * Back slash: please use `\\` diff --git a/package.json b/package.json index 8b6a9dd..4b2bc1e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "code-runner", "displayName": "Code Runner", "description": "Run C, C++, Java, JS, PHP, Python, Perl, Ruby, Go, Lua, Groovy, PowerShell, CMD, BASH, F#, C#, VBScript, TypeScript, CoffeeScript, Scala, Swift, Julia, Crystal, OCaml, R, AppleScript, Elixir, VB.NET, Clojure, Haxe, Objective-C, Rust, Racket, AutoHotkey, AutoIt, Kotlin, Dart, Pascal, Haskell, Nim, D", - "version": "0.9.1", + "version": "0.9.2", "publisher": "formulahendry", "icon": "images/logo.png", "engines": { diff --git a/src/codeManager.ts b/src/codeManager.ts index 62de2fc..f7a01af 100644 --- a/src/codeManager.ts +++ b/src/codeManager.ts @@ -90,7 +90,7 @@ export class CodeManager implements vscode.Disposable { public runByLanguage(): void { this._appInsightsClient.sendEvent("runByLanguage"); - const config = this.getConfiguration(); + const config = this.getConfiguration("code-runner"); const executorMap = config.get("executorMap"); vscode.window.showQuickPick(Object.keys(executorMap), { placeHolder: "Type or select language to run" }).then((languageId) => { if (languageId !== undefined) { @@ -131,7 +131,7 @@ export class CodeManager implements vscode.Disposable { } private initialize(): void { - this._config = this.getConfiguration(); + this._config = this.getConfiguration("code-runner"); this._cwd = this._config.get("cwd"); if (this._cwd) { return; @@ -149,11 +149,11 @@ export class CodeManager implements vscode.Disposable { this._cwd = TmpDir; } - private getConfiguration(): vscode.WorkspaceConfiguration { + private getConfiguration(section?: string): vscode.WorkspaceConfiguration { if (this._document) { - return vscode.workspace.getConfiguration("code-runner", this._document.uri); + return vscode.workspace.getConfiguration(section, this._document.uri); } else { - return vscode.workspace.getConfiguration("code-runner"); + return vscode.workspace.getConfiguration(section); } } @@ -345,8 +345,7 @@ export class CodeManager implements vscode.Disposable { if (this._codeFile) { const codeFileDir = this.getCodeFileDir(); - const config = this.getConfiguration(); - const pythonPath = config.get("python.pythonPath"); + const pythonPath = this.getConfiguration("python").get("pythonPath"); const placeholders: Array<{ regex: RegExp, replaceValue: string }> = [ // A placeholder that has to be replaced by the path of the folder opened in VS Code // If no folder is opened, replace with the directory of the code file @@ -363,7 +362,7 @@ export class CodeManager implements vscode.Disposable { { regex: /\$dirWithoutTrailingSlash/g, replaceValue: this.quoteFileName(this.getCodeFileDirWithoutTrailingSlash()) }, // A placeholder that has to be replaced by the directory of the code file { regex: /\$dir/g, replaceValue: this.quoteFileName(codeFileDir) }, - // A placeholder that has to be replaced by the Python executable in path + // A placeholder that has to be replaced by the path of Python interpreter { regex: /\$pythonPath/g, replaceValue: pythonPath }, ];