Skip to content

Commit

Permalink
Integrate with new Python Interpreter Path API V2 of Python extension
Browse files Browse the repository at this point in the history
  • Loading branch information
formulahendry committed Jul 3, 2020
1 parent d22c826 commit e63a4a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"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, Obj-C, Rust, Racket, Scheme, AutoHotkey, AutoIt, Kotlin, Dart, Pascal, Haskell, Nim, D, Lisp, Kit, V, SCSS, Sass, CUDA, Less",
"version": "0.10.0",
"featureFlags": {
"usingNewPythonInterpreterPathApi": true
"usingNewPythonInterpreterPathApi": true,
"usingNewPythonInterpreterPathApiV2": true
},
"publisher": "formulahendry",
"icon": "images/logo.png",
Expand Down
6 changes: 4 additions & 2 deletions src/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ export class Utility {
if (!extension.isActive) {
await extension.activate();
}
const pythonPath = extension.exports.settings.getExecutionCommand(document?.uri).join(" ");
return pythonPath;
const execCommand = extension.exports.settings.getExecutionDetails ?
extension.exports.settings.getExecutionDetails(document?.uri).execCommand :
extension.exports.settings.getExecutionCommand(document?.uri);
return execCommand ? execCommand.join(" ") : Constants.python;
} else {
return this.getConfiguration("python", document).get<string>("pythonPath");
}
Expand Down

0 comments on commit e63a4a7

Please sign in to comment.