File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -239,8 +239,18 @@ logging = true
239239
240240Inject code before or after your solution, injected code won't be submitted or run.
241241
242+ #### default imports
243+
244+ You can also pass ` before = true ` to inject default imports for the language.
245+ Supported languages are ` python ` , ` python3 ` , ` java `
246+
247+ Access default imports via ` require("leetcode.config.imports) `
248+
242249``` lua
243250injector = { --- @type table<lc.lang , lc.inject>
251+ [" python3" ] = {
252+ before = true
253+ },
244254 [" cpp" ] = {
245255 before = { " #include <bits/stdc++.h>" , " using namespace std;" },
246256 after = " int main() {}" ,
Original file line number Diff line number Diff line change @@ -241,6 +241,13 @@ logging = true
241241
242242在你的答案前后注入额外代码,注入的代码不会被提交或测试。
243243
244+ #### 默认导入
245+
246+ 您还可以传递 ` before = true ` 以注入语言的默认导入。
247+ 支持的语言为 ` python ` 、` python3 ` 、` java `
248+
249+ 通过 ` require("leetcode.config.imports) ` 访问默认导入
250+
244251``` lua
245252injector = { --- @type table<lc.lang , lc.inject>
246253 [" cpp" ] = {
@@ -316,6 +323,8 @@ image_support = false, -- 将此设置为 `true` 将禁用问题描述的换行
316323
317324- ` restore ` 尝试恢复默认问题布局
318325
326+ - ` inject ` 重新注入当前问题的代码
327+
319328- ` session `
320329
321330 - ` create ` 创建一个新的会话
You can’t perform that action at this time.
0 commit comments