Skip to content
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

Support locked problems #19

Merged
merged 2 commits into from
Mar 10, 2018
Merged

Conversation

TsFreddie
Copy link
Contributor

@TsFreddie TsFreddie commented Mar 9, 2018

Issue: #20

Added support for locked problems.
The regex is changed to match favorite, locked and state:

β˜… πŸ”’ βœ” [760] Find Anagram Mappings                                        Easy   (75.23 %)

The lock icon is grabbed from EmojiOne v2.0, please change it or add a license.

Please review the regex before merge.

@jdneo jdneo self-requested a review March 9, 2018 06:09
@jdneo jdneo self-assigned this Mar 9, 2018
@jdneo jdneo added the enhancement New feature or request label Mar 9, 2018
@jdneo
Copy link
Member

jdneo commented Mar 9, 2018

Hi @TsFreddie Thank you for the contribution! Looks nice!

Just interested about the intension of supporting locked problem. Could you please explain more about this feature to me?

@TsFreddie
Copy link
Contributor Author

I should say paid problems.

leetcode-cli does not give you all the problems with leetcode list -q L even if you are a premium user of leetcode.

image

It would be nice to be able to submit those problems as well.

@jdneo
Copy link
Member

jdneo commented Mar 9, 2018

@TsFreddie Oh, got your idea. That means: although the icon is a lock, but the paid user still can open the problem and try to solve it. Am I right?

I don't have a premium account so I was not aware of that. πŸ˜„

@jdneo jdneo added this to the 0.4.0 milestone Mar 9, 2018
@TsFreddie
Copy link
Contributor Author

Exactly. leetcode-cli isn't very descriptive about what it means by "locked".

@jdneo
Copy link
Member

jdneo commented Mar 9, 2018

Good to know that. Thanks for pointing out. πŸ‘

I still have some stuff need to do. Will review the PR in detail ASAP!

@@ -7,6 +7,8 @@ import { executeCommand } from "../utils/cpUtils";
import { DialogType, promptForOpenOutputChannel } from "../utils/uiUtils";

export interface IProblem {
favorate: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: favorite

@@ -19,19 +21,23 @@ export async function listProblems(channel: vscode.OutputChannel): Promise<IProb
if (leetCodeManager.getStatus() === UserStatus.SignedOut) {
return [];
}
const result: string = await executeCommand(channel, "node", [leetCodeBinaryPath, "list", "-q", "L"]);
const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode");
const showLocked = leetCodeConfig.get<string>("showLocked");
Copy link
Member

@jdneo jdneo Mar 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a type definition: const showLocked: boolean = ...

package.json Outdated
@@ -129,6 +129,11 @@
{
"title": "LeetCode",
"properties": {
"leetcode.showLocked": {
"type": "boolean",
"default": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we set the default value to false, since I think there are more common users than the premium ones.

@jdneo
Copy link
Member

jdneo commented Mar 9, 2018

@TsFreddie Just some small changes, thanks.

@jdneo
Copy link
Member

jdneo commented Mar 10, 2018

Great! Thanks.

@jdneo jdneo merged commit f3946b9 into LeetCode-OpenSource:master Mar 10, 2018
@ismailhkose
Copy link

image

ringcrl pushed a commit to ringcrl/vscode-leetcode that referenced this pull request Apr 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants