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

Remove interface declaration#81

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/remove-interface
Dec 27, 2018
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
2 changes: 1 addition & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -244,7 +244,7 @@
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install && node ./node_modules/leetcode-cli/bin/leetcode plugin -e leetcode.cn",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test",
"lint": "tslint --project tsconfig.json -e src/*.d.ts -t verbose"
},
Expand Down
5 changes: 3 additions & 2 deletionssrc/extension.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,6 +22,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
const leetCodeTreeDataProvider: LeetCodeTreeDataProvider = new LeetCodeTreeDataProvider(context);

context.subscriptions.push(
leetCodeStatusBarItem,
leetCodeChannel,
vscode.window.registerTreeDataProvider("leetCodeExplorer", leetCodeTreeDataProvider),
vscode.commands.registerCommand("leetcode.deleteCache", () => cache.deleteCache()),
vscode.commands.registerCommand("leetcode.toogleLeetCodeCn", () => plugin.toogleLeetCodeCn()),
Expand All@@ -45,6 +47,5 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
}

export function deactivate(): void {
leetCodeStatusBarItem.dispose();
leetCodeChannel.dispose();
// Do nothing.
}
11 changes: 2 additions & 9 deletionssrc/leetCodeChannel.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,14 +3,7 @@

import * as vscode from "vscode";

export interface ILeetCodeChannel {
appendLine(message: any, title?: string): void;
append(message: any): void;
show(): void;
dispose(): void;
}

class LeetCodeChannel implements ILeetCodeChannel {
class LeetCodeChannel implements vscode.Disposable {
private readonly channel: vscode.OutputChannel = vscode.window.createOutputChannel("LeetCode");

public appendLine(message: string): void {
Expand All@@ -30,4 +23,4 @@ class LeetCodeChannel implements ILeetCodeChannel {
}
}

export const leetCodeChannel:ILeetCodeChannel = new LeetCodeChannel();
export const leetCodeChannel:LeetCodeChannel = new LeetCodeChannel();
34 changes: 2 additions & 32 deletionssrc/leetCodeExecutor.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,37 +9,7 @@ import { executeCommand, executeCommandWithProgress } from "./utils/cpUtils";
import { DialogOptions } from "./utils/uiUtils";
import * as wsl from "./utils/wslUtils";

export interface ILeetCodeExecutor {
meetRequirements(): Promise<boolean>;
getLeetCodeBinaryPath(): Promise<string>;

/* section for cache command */
deleteCache(): Promise<string>;

/* section for user command */
getUserInfo(): Promise<string>;
signOut(): Promise<string>;
// TODO: implement login when leetcode-cli support login in batch mode.
// signIn(): Promise<string>;

/* section for problem command */
listProblems(showLocked: boolean): Promise<string>;
showProblem(id: string, language: string, outdir: string): Promise<string>;

/* section for session command */
listSessions(): Promise<string>;
enableSession(name: string): Promise<string>;
createSession(name: string): Promise<string>;

/* section for solution command */
submitSolution(filePath: string): Promise<string>;
testSolution(filePath: string, testString?: string): Promise<string>;

/* section for plugin command */
toggleLeetCodeCn(isEnable: boolean): Promise<string>;
}

class LeetCodeExecutor implements ILeetCodeExecutor {
class LeetCodeExecutor {
private leetCodeBinaryPath: string;
private leetCodeBinaryPathInWsl: string;

Expand DownExpand Up@@ -142,4 +112,4 @@ class LeetCodeExecutor implements ILeetCodeExecutor {
}
}

export const leetCodeExecutor:ILeetCodeExecutor = new LeetCodeExecutor();
export const leetCodeExecutor:LeetCodeExecutor = new LeetCodeExecutor();
12 changes: 2 additions & 10 deletionssrc/leetCodeManager.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,15 +10,7 @@ import { UserStatus } from "./shared";
import { DialogType, promptForOpenOutputChannel } from "./utils/uiUtils";
import * as wsl from "./utils/wslUtils";

export interface ILeetCodeManager extends EventEmitter {
getLoginStatus(): void;
getStatus(): UserStatus;
getUser(): string | undefined;
signIn(): void;
signOut(): void;
}

class LeetCodeManager extends EventEmitter implements ILeetCodeManager {
class LeetCodeManager extends EventEmitter {
private currentUser: string | undefined;
private userStatus: UserStatus;

Expand DownExpand Up@@ -123,4 +115,4 @@ class LeetCodeManager extends EventEmitter implements ILeetCodeManager {
}
}

export const leetCodeManager:ILeetCodeManager = new LeetCodeManager();
export const leetCodeManager:LeetCodeManager = new LeetCodeManager();
9 changes: 2 additions & 7 deletionssrc/leetCodeStatusBarItem.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,12 +4,7 @@
import * as vscode from "vscode";
import { UserStatus } from "./shared";

export interface ILeetCodeStatusBarItem {
updateStatusBar(status: UserStatus, user?: string): void;
dispose(): void;
}

class LeetCodeStatusBarItem implements ILeetCodeStatusBarItem {
class LeetCodeStatusBarItem implements vscode.Disposable {
private readonly statusBarItem: vscode.StatusBarItem;

constructor() {
Expand All@@ -35,4 +30,4 @@ class LeetCodeStatusBarItem implements ILeetCodeStatusBarItem {
}
}

export const leetCodeStatusBarItem:ILeetCodeStatusBarItem = new LeetCodeStatusBarItem();
export const leetCodeStatusBarItem:LeetCodeStatusBarItem = new LeetCodeStatusBarItem();

[8]ページ先頭

©2009-2025 Movatter.jp