Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix typos#110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jdneo merged 1 commit intomasterfromcs/typo
Feb 9, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletionsCHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
## [0.9.0]
### Changed
- Improve the experience of switching endpoint ([#85](https://github.com/jdneo/vscode-leetcode/issues/85))
- Usewebview to show the result page ([#76](https://github.com/jdneo/vscode-leetcode/issues/76))
- Useweb view to show the result page ([#76](https://github.com/jdneo/vscode-leetcode/issues/76))


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

## [0.5.1]
### Fixed
- Fix the bug when user's path containswhitespaces ([#34](https://github.com/jdneo/vscode-leetcode/issues/34))
- Fix the bug when user's path containswhite spaces ([#34](https://github.com/jdneo/vscode-leetcode/issues/34))

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

### Changed
- Simplify the command 'LeetCode: Test Current File' to 'LeetCode: Test' ([#18](https://github.com/jdneo/vscode-leetcode/issues/18))
- Will automatically savecuurent file when 'LeetCode: Test' command is triggered ([#17](https://github.com/jdneo/vscode-leetcode/issues/17))
- Will automatically savecurrent file when 'LeetCode: Test' command is triggered ([#17](https://github.com/jdneo/vscode-leetcode/issues/17))

## [0.3.0]
### Added
Expand All@@ -75,7 +75,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
## [0.2.1]
### Fixed
- Fix the wrong icon bug in LeetCode Explorer ([#9](https://github.com/jdneo/vscode-leetcode/issues/9))
- Fix the switch session bug when login session isexperied ([#12](https://github.com/jdneo/vscode-leetcode/issues/12))
- Fix the switch session bug when login session isexpired ([#12](https://github.com/jdneo/vscode-leetcode/issues/12))

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

## [0.1.2]
### Fixed
- Fix thedeplicated nodes in LeetCode Explorer bug ([#6](https://github.com/jdneo/vscode-leetcode/issues/6))
- Fix theduplicated nodes in LeetCode Explorer bug ([#6](https://github.com/jdneo/vscode-leetcode/issues/6))

## [0.1.1]
### Fixed
Expand Down
2 changes: 1 addition & 1 deletionREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -92,7 +92,7 @@
- There are 3 ways to test the answer:
- **Test with the default cases**
- **Write test cases in input box**
- **Test with thewriten cases in file**
- **Test with thewritten cases in file**

---

Expand Down
16 changes: 8 additions & 8 deletionsdocs/README_zh-CN.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@

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

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

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

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

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

- 在 `LeetCode Explorer` 中**右键**题目并选择 `Show Problem` 进行答题。
Expand All@@ -75,7 +75,7 @@

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

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

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

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

- 有下列三种测试集来源:
- **默认测试集**:Test with the default cases
- **在输入框内输入测试集**:Write test cases in input box
- **提供自定义测试集文件**:Test with thewriten cases in file
- **提供自定义测试集文件**:Test with thewritten cases in file

---

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

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

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

- 点击位于 VS Code 底部状态栏的 `LeetCode: ***` 管理 `LeetCode 存档`。你可以**切换**存档或者**创建**新的存档。
Expand Down
6 changes: 3 additions & 3 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@
],
"preview": true,
"activationEvents": [
"onCommand:leetcode.toogleLeetCodeCn",
"onCommand:leetcode.toggleLeetCodeCn",
"onCommand:leetcode.signin",
"onCommand:leetcode.signout",
"onCommand:leetcode.selectSessions",
Expand All@@ -47,7 +47,7 @@
"category": "LeetCode"
},
{
"command": "leetcode.toogleLeetCodeCn",
"command": "leetcode.toggleLeetCodeCn",
"title": "Switch Endpoint",
"category": "LeetCode",
"icon": {
Expand DownExpand Up@@ -133,7 +133,7 @@
"menus": {
"view/title": [
{
"command": "leetcode.toogleLeetCodeCn",
"command": "leetcode.toggleLeetCodeCn",
"when": "view == leetCodeExplorer",
"group": "navigation@0"
},
Expand Down
6 changes: 3 additions & 3 deletionssrc/commands/plugin.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,17 +9,17 @@ import { DialogType, promptForOpenOutputChannel, promptForSignIn } from "../util
import { deleteCache } from "./cache";

export async function switchEndpoint(): Promise<void> {
constisCnEnbaled: boolean = getLeetCodeEndpoint() === Endpoint.LeetCodeCN;
constisCnEnabled: boolean = getLeetCodeEndpoint() === Endpoint.LeetCodeCN;
const picks: Array<IQuickItemEx<string>> = [];
picks.push(
{
label: `${isCnEnbaled ? "" : "$(check) "}LeetCode`,
label: `${isCnEnabled ? "" : "$(check) "}LeetCode`,
description: "leetcode.com",
detail: `Enable LeetCode US`,
value: Endpoint.LeetCode,
},
{
label: `${isCnEnbaled ? "$(check) " : ""}力扣`,
label: `${isCnEnabled ? "$(check) " : ""}力扣`,
description: "leetcode-cn.com",
detail: `启用中国版 LeetCode`,
value: Endpoint.LeetCodeCN,
Expand Down
6 changes: 3 additions & 3 deletionssrc/commands/show.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,9 +49,9 @@ async function showProblemInternal(id: string): Promise<void> {
return;
}

constoutdir: string = await selectWorkspaceFolder();
await fse.ensureDir(outdir);
const result: string = await leetCodeExecutor.showProblem(id, language,outdir);
constoutDir: string = await selectWorkspaceFolder();
await fse.ensureDir(outDir);
const result: string = await leetCodeExecutor.showProblem(id, language,outDir);
const reg: RegExp = /\* Source Code:\s*(.*)/;
const match: RegExpMatchArray | null = result.match(reg);
if (match && match.length >= 2) {
Expand Down
4 changes: 2 additions & 2 deletionssrc/commands/submit.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,15 +6,15 @@ import { leetCodeExecutor } from "../leetCodeExecutor";
import { leetCodeManager } from "../leetCodeManager";
import { leetCodeResultProvider } from "../leetCodeResultProvider";
import { DialogType, promptForOpenOutputChannel, promptForSignIn } from "../utils/uiUtils";
import {getActivefilePath } from "../utils/workspaceUtils";
import {getActiveFilePath } from "../utils/workspaceUtils";

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

const filePath: string | undefined = awaitgetActivefilePath(uri);
const filePath: string | undefined = awaitgetActiveFilePath(uri);
if (!filePath) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletionssrc/commands/test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,15 +8,15 @@ import { leetCodeManager } from "../leetCodeManager";
import { leetCodeResultProvider } from "../leetCodeResultProvider";
import { IQuickItemEx, UserStatus } from "../shared";
import { DialogType, promptForOpenOutputChannel, showFileSelectDialog } from "../utils/uiUtils";
import {getActivefilePath } from "../utils/workspaceUtils";
import {getActiveFilePath } from "../utils/workspaceUtils";

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

const filePath: string | undefined = awaitgetActivefilePath(uri);
const filePath: string | undefined = awaitgetActiveFilePath(uri);
if (!filePath) {
return;
}
Expand All@@ -37,7 +37,7 @@ export async function testSolution(uri?: vscode.Uri): Promise<void> {
{
label: "$(file-text) Browse...",
description: "",
detail: "Test with thewriten cases in file",
detail: "Test with thewritten cases in file",
value: ":file",
},
);
Expand Down
2 changes: 1 addition & 1 deletionsrc/extension.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,7 +37,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
vscode.window.registerTreeDataProvider("leetCodeExplorer", leetCodeTreeDataProvider),
vscode.languages.registerCodeLensProvider({ scheme: "file" }, codeLensProvider),
vscode.commands.registerCommand("leetcode.deleteCache", () => cache.deleteCache()),
vscode.commands.registerCommand("leetcode.toogleLeetCodeCn", () => plugin.switchEndpoint()),
vscode.commands.registerCommand("leetcode.toggleLeetCodeCn", () => plugin.switchEndpoint()),
vscode.commands.registerCommand("leetcode.signin", () => leetCodeManager.signIn()),
vscode.commands.registerCommand("leetcode.signout", () => leetCodeManager.signOut()),
vscode.commands.registerCommand("leetcode.selectSessions", () => session.selectSession()),
Expand Down
10 changes: 5 additions & 5 deletionssrc/leetCodeExecutor.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -74,8 +74,8 @@ class LeetCodeExecutor {
);
}

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

public async listSessions(): Promise<string> {
Expand DownExpand Up@@ -113,12 +113,12 @@ class LeetCodeExecutor {

public async getCompaniesAndTags(): Promise<{ companies: { [key: string]: string[] }, tags: { [key: string]: string[] } }> {
// preprocess the plugin source
constcomponiesTagsPath: string = path.join(await leetCodeExecutor.getLeetCodeRootPath(), "lib", "plugins", "company.js");
constcomponiesTagsSrc: string = (await fse.readFile(componiesTagsPath, "utf8")).replace(
constcompaniesTagsPath: string = path.join(await leetCodeExecutor.getLeetCodeRootPath(), "lib", "plugins", "company.js");
constcompaniesTagsSrc: string = (await fse.readFile(companiesTagsPath, "utf8")).replace(
"module.exports = plugin",
"module.exports = { COMPONIES, TAGS }",
);
const { COMPONIES, TAGS } = requireFromString(componiesTagsSrc, componiesTagsPath);
const { COMPONIES, TAGS } = requireFromString(companiesTagsSrc, companiesTagsPath);
return { companies: COMPONIES, tags: TAGS };
}

Expand Down
2 changes: 1 addition & 1 deletionsrc/leetCodeManager.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -78,7 +78,7 @@ class LeetCodeManager extends EventEmitter {
if (match && match[1]) {
resolve(match[1]);
} else {
reject(new Error("Failed tosigin in."));
reject(new Error("Failed tosign in."));
}
});
});
Expand Down
2 changes: 1 addition & 1 deletionsrc/utils/workspaceUtils.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ export async function selectWorkspaceFolder(): Promise<string> {
return wsl.useWsl() ? wsl.toWslPath(workFolder) : workFolder;
}

export async functiongetActivefilePath(uri?: vscode.Uri): Promise<string | undefined> {
export async functiongetActiveFilePath(uri?: vscode.Uri): Promise<string | undefined> {
let textEditor: vscode.TextEditor | undefined;
if (uri) {
textEditor = await vscode.window.showTextDocument(uri, { preview: false });
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp