File tree 5 files changed +1614
-7
lines changed
5 files changed +1614
-7
lines changed Original file line number Diff line number Diff line change 10
10
".vscode-test" : true
11
11
},
12
12
"tslint.autoFixOnSave" : true ,
13
- "tslint.ignoreDefinitionFiles" : true
14
- }
13
+ "tslint.ignoreDefinitionFiles" : true ,
14
+ "editor.defaultFormatter" : null ,
15
+ "[typescript]" : {
16
+ "editor.defaultFormatter" : " vscode.typescript-language-features"
17
+ },
18
+ "[json]" : {
19
+ "editor.defaultFormatter" : " vscode.json-language-features"
20
+ }
21
+ }
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " vscode-leetcode" ,
3
- "displayName" : " LeetCode " ,
4
- "description" : " Solve LeetCode problems in VS Code" ,
5
- "version" : " 0.18.1 " ,
2
+ "name" : " vscode-leetcode-dggua " ,
3
+ "displayName" : " LeetCodeEveryday " ,
4
+ "description" : " Solve LeetCode problems in VS Code EveryDay " ,
5
+ "version" : " 0.19.0 " ,
6
6
"author" : " Sheng Chen" ,
7
- "publisher" : " LeetCode " ,
7
+ "publisher" : " dggua " ,
8
8
"license" : " MIT" ,
9
9
"icon" : " resources/LeetCode.png" ,
10
10
"engines" : {
32
32
" onCommand:leetcode.manageSessions" ,
33
33
" onCommand:leetcode.refreshExplorer" ,
34
34
" onCommand:leetcode.pickOne" ,
35
+ " onCommand:leetcode.pickToday" ,
35
36
" onCommand:leetcode.showProblem" ,
36
37
" onCommand:leetcode.previewProblem" ,
37
38
" onCommand:leetcode.searchProblem" ,
82
83
"title" : " Pick One" ,
83
84
"category" : " LeetCode"
84
85
},
86
+ {
87
+ "command" : " leetcode.pickToday" ,
88
+ "title" : " Pick Problem Today" ,
89
+ "category" : " LeetCode"
90
+ },
85
91
{
86
92
"command" : " leetcode.showProblem" ,
87
93
"title" : " Show Problem" ,
Original file line number Diff line number Diff line change @@ -52,6 +52,18 @@ export async function pickOne(): Promise<void> {
52
52
await showProblemInternal ( randomProblem ) ;
53
53
}
54
54
55
+ export async function pickToday ( context : vscode . ExtensionContext ) : Promise < void > {
56
+ const dailyProblems = await list . listDailyProblems ( context ) ;
57
+ const problemToday = dailyProblems . find ( problem => Number . parseInt ( problem . date . split ( "-" ) [ 2 ] ) == new Date ( ) . getDate ( ) )
58
+ const problems : IProblem [ ] = await list . listProblems ( ) ;
59
+ const targetProblem = problems . find ( problem => problem . id == problemToday ?. question . questionFrontendId )
60
+ if ( ! targetProblem ) {
61
+ vscode . window . showErrorMessage ( "Get problem today failed." ) ;
62
+ return ;
63
+ }
64
+ await showProblemInternal ( targetProblem )
65
+ }
66
+
55
67
export async function showProblem ( node ?: LeetCodeNode ) : Promise < void > {
56
68
if ( ! node ) {
57
69
return ;
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
60
60
vscode . commands . registerCommand ( "leetcode.previewProblem" , ( node : LeetCodeNode ) => show . previewProblem ( node ) ) ,
61
61
vscode . commands . registerCommand ( "leetcode.showProblem" , ( node : LeetCodeNode ) => show . showProblem ( node ) ) ,
62
62
vscode . commands . registerCommand ( "leetcode.pickOne" , ( ) => show . pickOne ( ) ) ,
63
+ vscode . commands . registerCommand ( "leetcode.pickToday" , ( ) => show . pickToday ( context ) ) ,
63
64
vscode . commands . registerCommand ( "leetcode.searchProblem" , ( ) => show . searchProblem ( ) ) ,
64
65
vscode . commands . registerCommand ( "leetcode.showSolution" , ( input : LeetCodeNode | vscode . Uri ) => show . showSolution ( input ) ) ,
65
66
vscode . commands . registerCommand ( "leetcode.refreshExplorer" , ( ) => leetCodeTreeDataProvider . refresh ( ) ) ,
You can’t perform that action at this time.
0 commit comments