diff --git a/src/leetCodeExecutor.ts b/src/leetCodeExecutor.ts index 5d76fdd1..263005c9 100644 --- a/src/leetCodeExecutor.ts +++ b/src/leetCodeExecutor.ts @@ -6,7 +6,7 @@ import * as fse from "fs-extra"; import * as path from "path"; import * as requireFromString from "require-from-string"; import * as vscode from "vscode"; -import { Endpoint, IProblem } from "./shared"; +import { Endpoint, IProblem, supportedPlugins } from "./shared"; import { executeCommand, executeCommandWithProgress } from "./utils/cpUtils"; import { genFileName } from "./utils/problemUtils"; import { DialogOptions, openUrl } from "./utils/uiUtils"; @@ -48,7 +48,7 @@ class LeetCodeExecutor { } return false; } - for (const plugin of ["company", "solution.discuss"]) { + for (const plugin of supportedPlugins) { try { // Check plugin await this.executeCommandEx("node", [await this.getLeetCodeBinaryPath(), "plugin", "-e", plugin]); } catch (error) { // Download plugin and activate diff --git a/src/shared.ts b/src/shared.ts index 942e5ba1..f543cd47 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -91,3 +91,9 @@ export enum Category { Company = "Company", Favorite = "Favorite", } + +export const supportedPlugins: string[] = [ + "company", + "solution.discuss", + "leetcode.cn", +]; diff --git a/tslint.json b/tslint.json index ae04746e..dec1de2e 100644 --- a/tslint.json +++ b/tslint.json @@ -5,6 +5,7 @@ ], "jsRules": {}, "rules": { + "forin": false, "object-literal-sort-keys": false, "indent": [ true,