Skip to content

[pull] master from LeetCode-OpenSource:master #3

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
69 changes: 24 additions & 45 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,49 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
linux:
name: Linux
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 12
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install Node.js modules
run: npm install
- name: Install Node.js modules
run: npm install

- name: Lint
run: npm run lint
- name: Lint
run: npm run lint

- name: VSCE Packge
run: npx vsce package
- name: VSCE Packge
run: npx vsce package

windows:
name: Windows
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 12
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install Node.js modules
run: npm install
- name: Install Node.js modules
run: npm install

- name: Lint
run: npm run lint
- name: Lint
run: npm run lint

- name: VSCE Packge
run: npx vsce package

darwin:
name: macOS
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 12

- name: Install Node.js modules
run: npm install

- name: Lint
run: npm run lint

- name: VSCE Packge
run: npx vsce package
- name: VSCE Packge
run: npx vsce package
9 changes: 6 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"editor.formatOnSave": true,
"editor.formatOnSave": false,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.insertFinalNewline": true,
Expand All @@ -10,5 +10,8 @@
".vscode-test": true
},
"tslint.autoFixOnSave": true,
"tslint.ignoreDefinitionFiles": true
}
"tslint.ignoreDefinitionFiles": true,
"prettier.tabWidth": 4,
"prettier.useTabs": false,
"prettier.printWidth": 150
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ All notable changes to the "leetcode" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [0.18.4]
### Added
- change graphql path

## [0.18.3]
### Added
- re-add cookie-based login method [PR#969](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/969)

## [0.18.2]
### Fixed
- fix login issue on VS Code Insiders [PR#968](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/968)

## [0.18.1]
### Changed
- change login way and add tracking logic option [PR#944](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/944)

## [0.18.0]
### Added
- Add `star` command in shortcuts [PR#601](https://github.com/LeetCode-OpenSource/vscode-leetcode/pull/601)
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
- English Document | [中文文档](https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/docs/README_zh-CN.md)

## ❗️ Attention ❗️- Workaround to login to LeetCode endpoint
> Note: If you are using `leetcode-cn.com`, you can just ignore this section.

> Note: If you are using `leetcode.cn`, you can just ignore this section.

Recently we observed that [the extension cannot login to leetcode.com endpoint anymore](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478). The root cause of this issue is that leetcode.com changed its login mechanism and so far there is no ideal way to fix that issue.

Expand All @@ -32,9 +33,10 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
> Note: If you want to use third-party login(**Recommended**), please make sure your account has been connected to the third-party. If you want to use `Cookie` login, click [here](https://github.com/LeetCode-OpenSource/vscode-leetcode/issues/478#issuecomment-564757098) to see the steps.

## Requirements

- [VS Code 1.30.1+](https://code.visualstudio.com/)
- [Node.js 10+](https://nodejs.org)
> NOTE: Please make sure that `Node` is in your `PATH` environment variable. You can also use the setting `leetcode.nodePath` to specify the location of your `Node.js` executable.
> NOTE: Please make sure that `Node` is in your `PATH` environment variable. You can also use the setting `leetcode.nodePath` to specify the location of your `Node.js` executable.

## Quick Start

Expand All @@ -43,6 +45,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
## Features

### Sign In/Out

<p align="center">
<img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/sign_in.png" alt="Sign in" />
</p>
Expand All @@ -52,24 +55,28 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
- You can also use the following command to sign in/out:
- **LeetCode: Sign in**
- **LeetCode: Sign out**

---

### Switch Endpoint

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

- By clicking the button ![btn_endpoint](https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/btn_endpoint.png) at the **explorer's navigation bar**, you can switch between different endpoints.

- The supported endpoints are:

- **leetcode.com**
- **leetcode-cn.com**
- **leetcode.cn**

> Note: The accounts of different endpoints are **not** shared. Please make sure you are using the right endpoint. The extension will use `leetcode.com` by default.

---

### Pick a Problem

<p align="center">
<img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/pick_problem.png" alt="Pick a Problem" />
</p>
Expand All @@ -86,11 +93,13 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
---

### Editor Shortcuts

<p align="center">
<img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/shortcuts.png" alt="Editor Shortcuts" />
</p>

- The extension supports 5 editor shortcuts (aka Code Lens):

- `Submit`: Submit your answer to LeetCode.
- `Test`: Test your answer with customized test cases.
- `Star/Unstar`: Star or unstar the current problem.
Expand All @@ -102,6 +111,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
---

### Search problems by Keywords

<p align="center">
<img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/search.png" alt="Search problems by Keywords" />
</p>
Expand All @@ -111,19 +121,18 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
---

### Manage Session

<p align="center">
<img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/session.png" alt="Manage Session" />
</p>

- To manage your LeetCode sessions, just clicking the `LeetCode: ***` at the bottom of the status bar. You can **switch** between sessions or **create**, **delete** a session.


## Settings

| Setting Name | Description | Default Value |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `leetcode.hideSolved` | Specify to hide the solved problems or not | `false` |
| `leetcode.showLocked` | Specify to show the locked problems or not. Only Premium users could open the locked problems | `false` |
| `leetcode.defaultLanguage` | Specify the default language used to solve the problem. Supported languages are: `bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`,`rust`, `scala`, `swift`, `typescript` | `N/A` |
| `leetcode.useWsl` | Specify whether to use WSL or not | `false` |
| `leetcode.endpoint` | Specify the active endpoint. Supported endpoints are: `leetcode`, `leetcode-cn` | `leetcode` |
Expand All @@ -137,6 +146,7 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh
| `leetcode.useEndpointTranslation` | Use endpoint's translation (if available) | `true` |
| `leetcode.colorizeProblems` | Add difficulty badge and colorize problems files in explorer tree | `true` |
| `leetcode.problems.sortStrategy` | Specify sorting strategy for problems list | `None` |
| `leetcode.allowReportData` | Allow LeetCode to report anonymous usage data to improve the product. list | `true` |

## Want Help?

Expand Down
Loading