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: leetcode.hideSolved not working#319

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/hide-solve
May 15, 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
7 changes: 6 additions & 1 deletionsrc/explorer/explorerNodeManager.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,8 @@
import * as _ from "lodash";
import { Disposable } from "vscode";
import * as list from "../commands/list";
import { Category, defaultProblem } from "../shared";
import { Category, defaultProblem, ProblemState } from "../shared";
import { shouldHideSolvedProblem } from "../utils/settingUtils";
import { LeetCodeNode } from "./LeetCodeNode";

class ExplorerNodeManager implements Disposable {
Expand All@@ -14,7 +15,11 @@ class ExplorerNodeManager implements Disposable {

public async refreshCache(): Promise<void> {
this.dispose();
const shouldHideSolved: boolean = shouldHideSolvedProblem();
for (const problem of await list.listProblems()) {
if (shouldHideSolved && problem.state === ProblemState.AC) {
continue;
}
this.explorerNodeMap.set(problem.id, new LeetCodeNode(problem));
for (const company of problem.companies) {
this.companySet.add(company);
Expand Down
12 changes: 12 additions & 0 deletionssrc/utils/settingUtils.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
// Copyright (c) jdneo. All rights reserved.
// Licensed under the MIT license.

import { workspace, WorkspaceConfiguration } from "vscode";

export function getWorkspaceConfiguration(): WorkspaceConfiguration {
return workspace.getConfiguration("leetcode");
}

export function shouldHideSolvedProblem(): boolean {
return getWorkspaceConfiguration().get<boolean>("hideSolved", false);
}
2 changes: 1 addition & 1 deletionsrc/utils/uiUtils.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
import * as vscode from "vscode";
import { getLeetCodeEndpoint } from "../commands/plugin";
import { leetCodeChannel } from "../leetCodeChannel";
import { getWorkspaceConfiguration } from "./workspaceUtils";
import { getWorkspaceConfiguration } from "./settingUtils";

export namespace DialogOptions {
export const open: vscode.MessageItem = { title: "Open" };
Expand Down
4 changes: 0 additions & 4 deletionssrc/utils/workspaceUtils.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,3 @@ export async function getActiveFilePath(uri?: vscode.Uri): Promise<string | unde
}
return wsl.useWsl() ? wsl.toWslPath(textEditor.document.uri.fsPath) : textEditor.document.uri.fsPath;
}

export function getWorkspaceConfiguration(): vscode.WorkspaceConfiguration {
return vscode.workspace.getConfiguration("leetcode");
}

[8]ページ先頭

©2009-2025 Movatter.jp