Skip to content

Commit

Permalink
Bump version to 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
formulahendry committed Mar 13, 2018
1 parent 1178b84 commit 2fb4d87
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `\\`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
15 changes: 7 additions & 8 deletions src/codeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>("executorMap");
vscode.window.showQuickPick(Object.keys(executorMap), { placeHolder: "Type or select language to run" }).then((languageId) => {
if (languageId !== undefined) {
Expand Down Expand Up @@ -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<string>("cwd");
if (this._cwd) {
return;
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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<string>("python.pythonPath");
const pythonPath = this.getConfiguration("python").get<string>("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
Expand All @@ -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 },
];

Expand Down

1 comment on commit 2fb4d87

@Oleksandr-Silin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this setting is misleading. It's not PYTHONPATH (which says where Python must look for imports), your settings is more PYTHONINTERPRETER(what python version to use), but it would be really nice to have real PYTHONPATH

Please sign in to comment.