【发布时间】:2023-02-24 06:14:18
【问题描述】:
我正在使用失控的 snakefile。我有点喜欢它是一个文件,但即使折叠了所有规则,我也必须处理一个长滚动条。 有没有一种方法/扩展允许代码通过特殊注释前缀折叠?
#% normalize data
rule count:
...
# some comment that should
rule divide:
...
rule drop_duplicates:
...
#% statistical tests
rule ttest:
...
#% output
rule all:
...
rule zip:
...
这样我就可以把它折叠成:
#% normalize data
#% statistical tests
#% output
我认为这比处理多个文件更容易处理。
谢谢你,
尝试在线搜索,发现一个应该可以执行此操作但无法使其工作的扩展程序 (https://marketplace.visualstudio.com/items?itemName=zokugun.explicit-folding)。 如果有人想检查我尝试过的 zokugun 显式折叠规则:
{
"workbench.colorTheme": "Default Dark+",
"remote.SSH.remotePlatform": {
"rocket": "linux",
"Jovian": "linux",
"JovianLocal": "linux"
},
"git.ignoreLegacyWarning": true,
"cmake.configureOnOpen": true,
"terminal.integrated.enableMultiLinePasteWarning": false,
"audioCues.taskCompleted": "on",
"audioCues.taskFailed": "on",
"notebook.lineNumbers": "on",
"window.zoomLevel": -1,
"jupyter.askForKernelRestart": false,
"[python]": {
"explicitFolding.rules": [
{
"beginRegex": "#%%",
"endRegex": "##%",
"autofold": true
},
{
"indentation": true,
"offSide": true
}
],
"explicitFolding.autoFold": "1",
},
"explicitFolding.rules": [
],
}
【问题讨论】: