Skip to content

Commit

Permalink
Fix TSLint
Browse files Browse the repository at this point in the history
  • Loading branch information
formulahendry committed May 1, 2020
1 parent 437456d commit c9ddb09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/codeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import * as os from "os";
import { basename, dirname, extname, join } from "path";
import * as vscode from "vscode";
import { AppInsightsClient } from "./appInsightsClient";
import { utility } from "./utility";
import { constants } from "./constants";
import { Constants } from "./constants";
import { Utility } from "./utility";

const TmpDir = os.tmpdir();

Expand Down Expand Up @@ -154,7 +154,7 @@ export class CodeManager implements vscode.Disposable {
}

private getConfiguration(section?: string): vscode.WorkspaceConfiguration {
return utility.getConfiguration(section, this._document);
return Utility.getConfiguration(section, this._document);
}

private getWorkspaceFolder(): string {
Expand Down Expand Up @@ -358,7 +358,7 @@ export class CodeManager implements vscode.Disposable {

if (this._codeFile) {
const codeFileDir = this.getCodeFileDir();
const pythonPath = cmd.includes("$pythonPath") ? await utility.getPythonPath(this._document) : constants.python;
const pythonPath = cmd.includes("$pythonPath") ? await Utility.getPythonPath(this._document) : Constants.python;
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 Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";

export class constants {
export class Constants {
public static readonly python = "python";
}
12 changes: 6 additions & 6 deletions src/utility.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
"use strict";
import * as vscode from "vscode";
import { constants } from "./constants";
import { Constants } from "./constants";

export class utility {
export class Utility {
public static async getPythonPath(document: vscode.TextDocument): Promise<string> {
try {
const extension = vscode.extensions.getExtension('ms-python.python');
const extension = vscode.extensions.getExtension("ms-python.python");
if (!extension) {
return constants.python;
return Constants.python;
}
const usingNewInterpreterStorage = extension.packageJSON?.featureFlags?.usingNewInterpreterStorage;
if (usingNewInterpreterStorage) {
if (!extension.isActive) {
await extension.activate();
}
const pythonPath = extension.exports.settings.getExecutionCommand(document?.uri).join(' ');
const pythonPath = extension.exports.settings.getExecutionCommand(document?.uri).join(" ");
return pythonPath;
} else {
return this.getConfiguration("python").get<string>("pythonPath");
}
} catch (error) {
return constants.python;
return Constants.python;
}
}

Expand Down

0 comments on commit c9ddb09

Please sign in to comment.