|
25 | 25 | ], |
26 | 26 | "preview": true, |
27 | 27 | "activationEvents": [ |
| 28 | + "onCommand:leetcode.toogleLeetCodeCn", |
28 | 29 | "onCommand:leetcode.signin", |
29 | 30 | "onCommand:leetcode.signout", |
30 | 31 | "onCommand:leetcode.selectSessions", |
|
39 | 40 | "main": "./out/src/extension", |
40 | 41 | "contributes": { |
41 | 42 | "commands": [ |
| 43 | + { |
| 44 | + "command": "leetcode.toogleLeetCodeCn", |
| 45 | + "title": "Switch endpoint", |
| 46 | + "category": "LeetCode", |
| 47 | + "icon": "resources/cn.png" |
| 48 | + }, |
42 | 49 | { |
43 | 50 | "command": "leetcode.signin", |
44 | 51 | "title": "Sign in", |
|
114 | 121 | "menus": { |
115 | 122 | "view/title": [ |
116 | 123 | { |
117 | | - "command": "leetcode.signin", |
| 124 | + "command": "leetcode.toogleLeetCodeCn", |
118 | 125 | "when": "view == leetCodeExplorer", |
119 | 126 | "group": "navigation@0" |
120 | 127 | }, |
121 | 128 | { |
122 | | - "command": "leetcode.searchProblem", |
| 129 | + "command": "leetcode.signin", |
123 | 130 | "when": "view == leetCodeExplorer", |
124 | 131 | "group": "navigation@1" |
125 | 132 | }, |
126 | 133 | { |
127 | | - "command": "leetcode.refreshExplorer", |
| 134 | + "command": "leetcode.searchProblem", |
128 | 135 | "when": "view == leetCodeExplorer", |
129 | 136 | "group": "navigation@2" |
| 137 | + }, |
| 138 | + { |
| 139 | + "command": "leetcode.refreshExplorer", |
| 140 | + "when": "view == leetCodeExplorer", |
| 141 | + "group": "navigation@3" |
130 | 142 | } |
131 | 143 | ], |
132 | 144 | "view/item/context": [ |
|
172 | 184 | "leetcode.showLocked": { |
173 | 185 | "type": "boolean", |
174 | 186 | "default": false, |
175 | | - "scope": "window", |
| 187 | + "scope": "application", |
176 | 188 | "description": "Show locked problems." |
177 | 189 | }, |
178 | 190 | "leetcode.defaultLanguage": { |
|
193 | 205 | "scala", |
194 | 206 | "swift" |
195 | 207 | ], |
196 | | - "scope": "window", |
| 208 | + "scope": "application", |
197 | 209 | "description": "Default language for solving the problems." |
198 | 210 | }, |
199 | 211 | "leetcode.showSetDefaultLanguageHint": { |
200 | 212 | "type": "boolean", |
201 | 213 | "default": true, |
202 | | - "scope": "window", |
| 214 | + "scope": "application", |
203 | 215 | "description": "Show a hint to set the default language." |
204 | 216 | }, |
205 | 217 | "leetcode.useWsl": { |
206 | 218 | "type": "boolean", |
207 | 219 | "default": false, |
208 | | - "scope": "window", |
| 220 | + "scope": "application", |
209 | 221 | "description": "Use Node.js inside the Windows Subsystem for Linux." |
| 222 | + }, |
| 223 | + "leetcode.endpoint": { |
| 224 | + "type": "string", |
| 225 | + "default": "leetcode", |
| 226 | + "scope": "application", |
| 227 | + "enum": [ |
| 228 | + "leetcode", |
| 229 | + "leetcode-cn" |
| 230 | + ], |
| 231 | + "description": "Endpoint of the user account." |
210 | 232 | } |
211 | 233 | } |
212 | 234 | } |
|
216 | 238 | "vscode:prepublish": "npm run compile", |
217 | 239 | "compile": "tsc -p ./", |
218 | 240 | "watch": "tsc -watch -p ./", |
219 | | - "postinstall": "node ./node_modules/vscode/bin/install", |
| 241 | + "postinstall": "node ./node_modules/vscode/bin/install && node ./node_modules/leetcode-cli/bin/leetcode plugin -i leetcode.cn", |
220 | 242 | "test": "npm run compile && node ./node_modules/vscode/bin/test", |
221 | 243 | "lint": "tslint --project tsconfig.json -e src/*.d.ts -t verbose" |
222 | 244 | }, |
|
0 commit comments