Skip to content

Commit dba4fdd

Browse files
houtianzejdneo
authored andcommitted
Fix the unable to login problem each time VSCode starts (LeetCode-OpenSource#212)
1 parent 0300764 commit dba4fdd

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/leetCodeExecutor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as fse from "fs-extra";
66
import * as path from "path";
77
import * as requireFromString from "require-from-string";
88
import * as vscode from "vscode";
9-
import { Endpoint, IProblem } from "./shared";
9+
import { Endpoint, IProblem, supportedPlugins } from "./shared";
1010
import { executeCommand, executeCommandWithProgress } from "./utils/cpUtils";
1111
import { genFileName } from "./utils/problemUtils";
1212
import { DialogOptions, openUrl } from "./utils/uiUtils";
@@ -48,7 +48,7 @@ class LeetCodeExecutor {
4848
}
4949
return false;
5050
}
51-
for (const plugin of ["company", "solution.discuss"]) {
51+
for (const plugin of supportedPlugins) {
5252
try { // Check plugin
5353
await this.executeCommandEx("node", [await this.getLeetCodeBinaryPath(), "plugin", "-e", plugin]);
5454
} catch (error) { // Download plugin and activate

src/shared.ts

+6
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,9 @@ export enum Category {
9191
Company = "Company",
9292
Favorite = "Favorite",
9393
}
94+
95+
export const supportedPlugins: string[] = [
96+
"company",
97+
"solution.discuss",
98+
"leetcode.cn",
99+
];

tslint.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
],
66
"jsRules": {},
77
"rules": {
8+
"forin": false,
89
"object-literal-sort-keys": false,
910
"indent": [
1011
true,

0 commit comments

Comments
 (0)