8000 Fix typos (#110) · b0g-lab/vscode-leetcode@cae75fe · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cae75fe

Browse files
authored
1 parent 1ac1e46 commit cae75fe

12 files changed

+36
-36
lines changed

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1515
## [0.9.0]
1616
### Changed
1717
- Improve the experience of switching endpoint ([#85](https://github.com/jdneo/vscode-leetcode/issues/85))
18-
- Use webview to show the result page ([#76](https://github.com/jdneo/vscode-leetcode/issues/76))
18+
- Use web view to show the result page ([#76](https://github.com/jdneo/vscode-leetcode/issues/76))
1919

2020

2121
## [0.8.2]
@@ -54,7 +54,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
5454

5555
## [0.5.1]
5656
### Fixed
57-
- Fix the bug when user's path contains whitespaces ([#34](https://github.com/jdneo/vscode-leetcode/issues/34))
57+
- Fix the bug when user's path contains white spaces ([#34](https://github.com/jdneo/vscode-leetcode/issues/34))
5858

5959
## [0.5.0]
6060
### Added
@@ -66,7 +66,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
6666

6767
### Changed
6868
- Simplify the command 'LeetCode: Test Current File' to 'LeetCode: Test' ([#18](https://github.com/jdneo/vscode-leetcode/issues/18))
69-
- Will automatically save cuurent file when 'LeetCode: Test' command is triggered ([#17](https://github.com/jdneo/vscode-leetcode/issues/17))
69+
- Will automatically save current file when 'LeetCode: Test' command is triggered ([#17](https://github.com/jdneo/vscode-leetcode/issues/17))
7070

7171
## [0.3.0]
7272
### Added
@@ -75,7 +75,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
7575
## [0.2.1]
7676
### Fixed
7777
- Fix the wrong icon bug in LeetCode Explorer ([#9](https://github.com/jdneo/vscode-leetcode/issues/9))
78-
- Fix the switch session bug when login session is experied ([#12](https://github.com/jdneo/vscode-leetcode/issues/12))
78+
- Fix the switch session bug when login session is expired ([#12](https://github.com/jdneo/vscode-leetcode/issues/12))
7979

8080
## [0.2.0]
8181
### Added
@@ -86,7 +86,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
8686

8787
## [0.1.2]
8888
### Fixed
89-
- Fix the deplicated nodes in LeetCode Explorer bug ([#6](https://github.com/jdneo/vscode-leetcode/issues/6))
89+
- Fix the duplicated nodes in LeetCode Explorer bug ([#6](https://github.com/jdneo/vscode-leetcode/issues/6))
9090

9191
## [0.1.1]
9292
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
- There are 3 ways to test the answer:
9393
- **Test with the default cases**
9494
- **Write test cases in input box**
95-
- **Test with the writen cases in file**
95+
- **Test with the written cases in file**
9696

9797
---
9898

docs/README_zh-CN.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
### 登入登出
3838
<p align="center">
39-
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/sign_in.png" alt="Sign in" />
39+
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/sign_in.png" alt="登入登出" />
4040
</p>
4141

4242
- 点击 `LeetCode Explorer` 中的 `Sign in to LeetCode` 即可登入。
@@ -49,7 +49,7 @@
4949

5050
### 切换 LeetCode 版本
5151
<p align="center">
52-
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/endpoint.png" alt="Switch Endpoint" />
52+
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/endpoint.png" alt="切换 LeetCode 版本" />
5353
</p>
5454

5555
- LeetCode 目前有**英文版****中文版**两种版本。点击 `LeetCode Explorer` 导航栏中的 ![btn_endpoint](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/btn_endpoint.png) 按钮可切换版本。
@@ -64,7 +64,7 @@
6464

6565
### 选择题目
6666
<p align="center">
67-
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/pick_problem.png" alt="Pick a problem" />
67+
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/pick_problem.png" alt="选择题目" />
6868
</p>
6969

7070
-`LeetCode Explorer`**右键**题目并选择 `Show Problem` 进行答题。
@@ -75,7 +75,7 @@
7575

7676
### 提交答案
7777
<p align="center">
78-
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/submit.png" alt="Switch Endpoint" />
78+
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/submit.png" alt="提交答案" />
7979
</p>
8080

8181
- 通过点击文件最下方的 `🙏 Submit to LeetCode` 可提交答案。 你也可以触发 **LeetCode: Submit to LeetCode** 命令将**当前**文件作为答案进行提交。
@@ -84,21 +84,21 @@
8484

8585
### 测试答案
8686
<p align="center">
87-
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/test.png" alt="Switch Endpoint" />
87+
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/test.png" alt="测试答案" />
8888
</p>
8989

9090
- 在编辑区内右键并选择 `Test in LeetCode`,可对**当前**答案进行测试。
9191

9292
- 有下列三种测试集来源:
9393
- **默认测试集**:Test with the default cases
9494
- **在输入框内输入测试集**:Write test cases in input box
95-
- **提供自定义测试集文件**:Test with the writen cases in file
95+
- **提供自定义测试集文件**:Test with the written cases in file
9696

9797
---
9898

9999
### 通过关键字搜索题目
100100
<p align="center">
101-
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/search.png" alt="Switch Endpoint" />
101+
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/search.png" alt="通过关键字搜索题目" />
102102
</p>
103103

104104
- 点击 `LeetCode Explorer` 导航栏中的 ![btn_search](https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/btn_search.png) 按钮可按照关键字搜索题目。
@@ -107,7 +107,7 @@
107107

108108
### 管理存档
109109
<p align="center">
110-
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/session.png" alt="Switch Endpoint" />
110+
<img src="https://raw.githubusercontent.com/jdneo/vscode-leetcode/master/docs/imgs/session.png" alt="管理存档" />
111111
</p>
112112

113113
- 点击位于 VS Code 底部状态栏的 `LeetCode: ***` 管理 `LeetCode 存档`。你可以**切换**存档或者**创建**新的存档。

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
],
2727
"preview": true,
2828
"activationEvents": [
29-
"onCommand:leetcode.toogleLeetCodeCn",
29+
"onCommand:leetcode.toggleLeetCodeCn",
3030
"onCommand:leetcode.signin",
3131
"onCommand:leetcode.signout",
3232
"onCommand:leetcode.selectSessions",
@@ -47,7 +47,7 @@
4747
"category": "LeetCode"
4848
},
4949
{
50-
"command": "leetcode.toogleLeetCodeCn",
50+
"command": "leetcode.toggleLeetCodeCn",
5151
"title": "Switch Endpoint",
5252
"category": "LeetCode",
5353
"icon": {
@@ -133,7 +133,7 @@
133133
"menus": {
134134
"view/title": [
135135
{
136-
"command": "leetcode.toogleLeetCodeCn",
136+
"command": "leetcode.toggleLeetCodeCn",
137137
"when": "view == leetCodeExplorer",
138138
"group": "navigation@0"
139139
},

src/commands/plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ import { DialogType, promptForOpenOutputChannel, promptForSignIn } from "../util
99
import { deleteCache } from "./cache";
1010

1111
export async function switchEndpoint(): Promise<void> {
12-
const isCnEnbaled: boolean = getLeetCodeEndpoint() === Endpoint.LeetCodeCN;
12+
const isCnEnabled: boolean = getLeetCodeEndpoint() === Endpoint.LeetCodeCN;
1313
const picks: Array<IQuickItemEx<string>> = [];
1414
picks.push(
1515
{
16-
label: `${isCnEnbaled ? "" : "$(check) "}LeetCode`,
16+
label: `${isCnEnabled ? "" : "$(check) "}LeetCode`,
1717
description: "leetcode.com",
1818
detail: `Enable LeetCode US`,
1919
value: Endpoint.LeetCode,
2020
},
2121
{
22-
label: `${isCnEnbaled ? "$(check) " : ""}力扣`,
22+
label: `${isCnEnabled ? "$(check) " : ""}力扣`,
2323
description: "leetcode-cn.com",
2424
detail: `启用中国版 LeetCode`,
2525
value: Endpoint.LeetCodeCN,

src/commands/show.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ async function showProblemInternal(id: string): Promise<void> {
4949
return;
5050
}
5151

52-
const outdir: string = await selectWorkspaceFolder();
53-
await fse.ensureDir(outdir);
54-
const result: string = await leetCodeExecutor.showProblem(id, language, outdir);
52+
const outDir: string = await selectWorkspaceFolder();
53+
await fse.ensureDir(outDir);
54+
const result: string = await leetCodeExecutor.showProblem(id, language, outDir);
5555
const reg: RegExp = /\* Source Code:\s*(.*)/;
5656
const match: RegExpMatchArray | null = result.match(reg);
5757
if (match && match.length >= 2) {

src/commands/submit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { leetCodeExecutor } from "../leetCodeExecutor";
66
import { leetCodeManager } from "../leetCodeManager";
77
import { leetCodeResultProvider } from "../leetCodeResultProvider";
88
import { DialogType, promptForOpenOutputChannel, promptForSignIn } from "../utils/uiUtils";
9-
import { getActivefilePath } from "../utils/workspaceUtils";
9+
import { getActiveFilePath } from "../utils/workspaceUtils";
1010

1111
export async function submitSolution(uri?: vscode.Uri): Promise<void> {
1212
if (!leetCodeManager.getUser()) {
1313
promptForSignIn();
1414
return;
1515
}
1616

17-
const filePath: string | undefined = await getActivefilePath(uri);
17+
const filePath: string | undefined = await getActiveFilePath(uri);
1818
if (!filePath) {
1919
return;
2020
}

src/commands/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import { leetCodeManager } from "../leetCodeManager";
88
import { leetCodeResultProvider } from "../leetCodeResultProvider";
99
import { IQuickItemEx, UserStatus } from "../shared";
1010
import { DialogType, promptForOpenOutputChannel, showFileSelectDialog } from "../utils/uiUtils";
11-
import { getActivefilePath } from "../utils/workspaceUtils";
11+
import { getActiveFilePath } from "../utils/workspaceUtils";
1212

1313
export async function testSolution(uri?: vscode.Uri): Promise<void> {
1414
try {
1515
if (leetCodeManager.getStatus() === UserStatus.SignedOut) {
1616
return;
1717
}
1818

19-
const filePath: string | undefined = await getActivefilePath(uri);
19+
const filePath: string | undefined = await getActiveFilePath(uri);
2020
if (!filePath) {
2121
return;
2222
}
@@ -37,7 +37,7 @@ export async function testSolution(uri?: vscode.Uri): Promise<void> {
3737
{
3838
label: "$(file-text) Browse...",
3939
description: "",
40-
detail: "Test with the writen cases in file",
40+
detail: "Test with the written cases in file",
4141
value: ":file",
4242
},
4343
);

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
3737
vscode.window.registerTreeDataProvider("leetCodeExplorer", leetCodeTreeDataProvider),
3838
vscode.languages.registerCodeLensProvider({ scheme: "file" }, codeLensProvider),
3939
vscode.commands.registerCommand("leetcode.deleteCache", () => cache.deleteCache()),
40-
vscode.commands.registerCommand("leetcode.toogleLeetCodeCn", () => plugin.switchEndpoint()),
40+
vscode.commands.registerCommand("leetcode.toggleLeetCodeCn", () => plugin.switchEndpoint()),
4141
vscode.commands.registerCommand("leetcode.signin", () => leetCodeManager.signIn()),
4242
vscode.commands.registerCommand("leetcode.signout", () => leetCodeManager.signOut()),
4343
vscode.commands.registerCommand("leetcode.selectSessions", () => session.selectSession()),

src/leetCodeExecutor.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class LeetCodeExecutor {
7474
);
7575
}
7676

77-
public async showProblem(id: string, language: string, outdir: string): Promise<string> {
78-
return await this.executeCommandWithProgressEx("Fetching problem data...", "node", [await this.getLeetCodeBinaryPath(), "show", id, "-gx", "-l", language, "-o", `"${outdir}"`]);
77+
public async showProblem(id: string, language: string, outDir: string): Promise<string> {
78+
return await this.executeCommandWithProgressEx("Fetching problem data...", "node", [await this.getLeetCodeBinaryPath(), "show", id, "-gx", "-l", language, "-o", `"${outDir}"`]);
7979
}
8080

8181
public async listSessions(): Promise<string> {
@@ -113,12 +113,12 @@ class LeetCodeExecutor {
113113

114114
public async getCompaniesAndTags(): Promise<{ companies: { [key: string]: string[] }, tags: { [key: string]: string[] } }> {
115115
// preprocess the plugin source
116-
const componiesTagsPath: string = path.join(await leetCodeExecutor.getLeetCodeRootPath(), "lib", "plugins", "company.js");
117-
const componiesTagsSrc: string = (await fse.readFile(componiesTagsPath, "utf8")).replace(
116+
const companiesTagsPath: string = path.join(await leetCodeExecutor.getLeetCodeRootPath(), "lib", "plugins", "company.js");
117+
const companiesTagsSrc: string = (await fse.readFile(companiesTagsPath, "utf8")).replace(
118118
"module.exports = plugin",
119119
"module.exports = { COMPONIES, TAGS }",
120120
);
121-
const { COMPONIES, TAGS } = requireFromString(componiesTagsSrc, componiesTagsPath);
121+
const { COMPONIES, TAGS } = requireFromString(companiesTagsSrc, companiesTagsPath);
122122
return { companies: COMPONIES, tags: TAGS };
123123
}
124124

src/leetCodeManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class LeetCodeManager extends EventEmitter {
7878
if (match && match[1]) {
7979
resolve(match[1]);
8080
} else {
81-
reject(new Error("Failed to sigin in."));
81+
reject(new Error("Failed to sign in."));
8282
}
8383
});
8484
});

src/utils/workspaceUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function selectWorkspaceFolder(): Promise<string> {
2323
return wsl.useWsl() ? wsl.toWslPath(workFolder) : workFolder;
2424
}
2525

26-
export async function getActivefilePath(uri?: vscode.Uri): Promise<string | undefined> {
26+
export async function getActiveFilePath(uri?: vscode.Uri): Promise<string | undefined> {
2727
let textEditor: vscode.TextEditor | undefined;
2828
if (uri) {
2929
textEditor = await vscode.window.showTextDocument(uri, { preview: false });

0 commit comments

Comments
 (0)
0