Skip to content

Commit

Permalink
feat: 整理代码结构,添加题解的入口和刷新列表的icon
Browse files Browse the repository at this point in the history
  • Loading branch information
rottenpen committed Dec 23, 2020
1 parent 76cbf62 commit fecd02e
Show file tree
Hide file tree
Showing 29 changed files with 73 additions and 133 deletions.
1 change: 1 addition & 0 deletions media/dark/addmore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/dark/create.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/dark/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/dark/refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/light/addmore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/light/create.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/light/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/light/refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 41 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,62 @@
],
"main": "./out/extension.js",
"contributes": {
"menus": {
"view/title": [
{
"command": "interview.refresh",
"when": "view == interview",
"group": "navigation"
}
],
"view/item/context": [
{
"command": "interview.openAnswer",
"when": "view == interview",
"group": "inline"
}
]
},
"views": {
"front-end-interview": [
"interview": [
{
"id": "interview",
"name": "Interview"
"name": "前端每日面试题"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "front-end-interview",
"title": "front-end-interview",
"id": "interview",
"title": "前端每日面试题",
"icon": "media/interview.svg"
}
]
},
"commands": [],
"viewsWelcome": [
{
"view": "interview",
"contents": "hello world"
}
],
"commands": [
{
"command": "interview.refresh",
"title": "Refresh",
"icon": {
"light": "media/light/refresh.svg",
"dark": "media/dark/refresh.svg"
}
},
{
"command": "interview.openAnswer",
"title": "题解"
}
],
"configuration": [
{
"title": "front-end-interview",
"title": "interview",
"properties": {
"interview.workspaceFolder": {
"type": "string",
Expand All @@ -56,7 +91,6 @@
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/ali-oss": "^6.0.5",
"@types/fs-extra": "^9.0.1",
"@types/glob": "^7.1.3",
"@types/mocha": "^8.0.0",
Expand All @@ -71,7 +105,6 @@
"vscode-test": "^1.4.0"
},
"dependencies": {
"ali-oss": "^6.10.0",
"fs-extra": "^9.0.1"
}
}
4 changes: 4 additions & 0 deletions src/command/openAnswer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// TODO: 查看问题答案的 webview
export function openAnswer(): void {
return;
}
4 changes: 4 additions & 0 deletions src/command/postAnswer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// TODO: 提交问题的 command
export async function postAnswer(): Promise<void> {
return;
}
20 changes: 14 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
import * as vscode from "vscode";
import { commands, ExtensionContext, window, workspace } from "vscode";
import { commands, window } from "vscode";
import { openQuestion } from "./command/openQuestion";
import { Interview } from "./interviewTreeView";
import { Interview } from "./treeview/interviewTreeView";
export async function activate(
context: vscode.ExtensionContext
): Promise<void> {
try {
// -------- interview 相关 !!! 才是重点!!!!!!!!!!!!!!!!!!!!!!!!!-------------
const interviewProvider = new Interview();
// -------- interview 相关 -------------
const interviewProvider = new Interview();
window.createTreeView("interview", {
treeDataProvider: interviewProvider,
});
commands.registerCommand("interview.openQuestion", (name, index) => {
openQuestion(name, index);
});

// -------- interview 相关 !!! 才是重点!!!!!!!!!!!!!!!!!!!!!!!!!-------------
commands.registerCommand("interview.refresh", (name, index) => {
vscode.window.showInformationMessage("刷新数据");
});
commands.registerCommand("interview.openAnswer", (name, index) => {
vscode.window.showInformationMessage("查看答案");
});
commands.registerCommand("interview.postAnswer", (name, index) => {
vscode.window.showInformationMessage("提交答案");
});
// -------- interview 相关 -------------
} catch (error) {
window.showInformationMessage(error);
}
Expand Down
1 change: 1 addition & 0 deletions src/globalState.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// 公共状态管理
1 change: 0 additions & 1 deletion src/media/interview.svg

This file was deleted.

5 changes: 0 additions & 5 deletions src/sources/1.[手写]实现一个PromiseAll.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/sources/10.[网络基础]你知道SameSite吗.md

This file was deleted.

This file was deleted.

Loading

0 comments on commit fecd02e

Please sign in to comment.