是否可以在线路中间崩溃自定义区域?
VS代码支持在行中间创建自定义折叠区域吗?
我有变量以类似于base64
的格式存储图片,它们是非常大的字符串,我的目标是折叠不重要的部分,只剩下一些重要的东西:
示例 :
picture1 ="|<test1>ron[189,278,461,30]*172$461.0000000000000000000000zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzU00000000000000000000000000000000000000TzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzU"
picture2 ="|<test2>dkc[114,100,136,134]*136$136.zzzzzkM00Dzzzk007zzzXzzzzzzw0000Tzzy0007zzy7zzzzzzU0000zzzU000Dzzsm0B8Ty0000000003zzzzz8Ds04ETk000000000TzzzzykUzWV3z0000000003zzzzzxW03vxTw000040000TzzzzzrE0Dyzjk0400M0003zzzzzzz03ysAz00Ts1k001Dzzzzzzw0zvU3w0zzk7U00NzzzzzzXk/zc"
picture3 ="|<test3>zms[650,114,72,48]*180$72.kzz000000000Uzy0000000000zw000000z000000CTU000000000Czk000000000Szk000010000zzk000000001zzk000000003zzk000A00007xzk000C0000Dzzk0008k000Tzzk00080000Tzzk000E3000TzzU00003U"
然后折叠后看起来像这样:
picture1 ="|<test1>ron[189,278,461,30]*172..."
picture2 ="|<test2>dkc[114,100,136,134]*136..."
picture3 ="|<test3>zms[650,114,72,48]*180...."
其中...
是折叠的字符串的一部分。
我的想法是使用REGEX或类似的恒星区域创建折叠规则
:$
结束区域:“
我找到了此扩展名:
,但看起来它
"maptz.regionfolder": {
"[txt]": {
"foldStartRegex": "\\$.*",
"foldEndRegex": "\"",
"disableFolding": false //Turn off #region folding for this language
}
},
。
字符串是多线,但是当我将其返回到一行时,
将字符串分解为多行。
我的语言不支持 ?
Does VS Code support create custom folding regions in the middle of lines?
I have variables storing pictures in a format similar to base64
, they are very large strings, my goal is to fold the not important part, leaving only some important things visible:
Example:
picture1 ="|<test1>ron[189,278,461,30]*172$461.0000000000000000000000zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzU00000000000000000000000000000000000000TzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzU"
picture2 ="|<test2>dkc[114,100,136,134]*136$136.zzzzzkM00Dzzzk007zzzXzzzzzzw0000Tzzy0007zzy7zzzzzzU0000zzzU000Dzzsm0B8Ty0000000003zzzzz8Ds04ETk000000000TzzzzykUzWV3z0000000003zzzzzxW03vxTw000040000TzzzzzrE0Dyzjk0400M0003zzzzzzz03ysAz00Ts1k001Dzzzzzzw0zvU3w0zzk7U00NzzzzzzXk/zc"
picture3 ="|<test3>zms[650,114,72,48]*180$72.kzz000000000Uzy0000000000zw000000z000000CTU000000000Czk000000000Szk000010000zzk000000001zzk000000003zzk000A00007xzk000C0000Dzzk0008k000Tzzk00080000Tzzk000E3000TzzU00003U"
Then after folding it would look like this:
picture1 ="|<test1>ron[189,278,461,30]*172..."
picture2 ="|<test2>dkc[114,100,136,134]*136..."
picture3 ="|<test3>zms[650,114,72,48]*180...."
Where ...
is the part of the string that got folded.
My idea was to create a folding rule using regex or something similar
Star region: $
End region: "
I have found this extension: maptz.regionfolder, but looks like it doesn't support single line folding.
I have tested it with, settings.json
:
"maptz.regionfolder": {
"[txt]": {
"foldStartRegex": "\\$.*",
"foldEndRegex": "\"",
"disableFolding": false //Turn off #region folding for this language
}
},
As seen in the gif, it works as long the string is multi-line, however when i return it to a single line, it doesnt.
My language doesnt support breaking strings into multiple lines.
Does VS Code have built-in support for this? or someone know any other way I could achieve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
多亏了这个问题避免在html标签(vscode)中避免省略可以对您有用的扩展名: inline fold 。首先是演示:
我使用了这些设置(在
settings.json
中):我不知道您的语言
.txt
Demo和LagansingID的文件。我还制作了此键调整(在
keybindings.json
中或通过键盘快捷键编辑器):Thanks to this question avoid ellipsis in Html tags (VSCode) I see there is an extension that could work for you: Inline fold. First a demo:
I used these settings (in
settings.json
):I didn't know your language so I just used a
plaintext
.txt
file for the demo and languageID.I also made this keybinding (in
keybindings.json
or through the Keyboard Shortcuts editor):目前不支持此功能。在VS代码的github repo上跟踪它:支持折叠范围#在线路#折叠范围# 50840 。 您可以向您的支持显示您的支持。对这个问题给予大拇指的反应。但是请不要发表“我也是”评论。 value。
现在,您可以查看
moalamri.inline-fold
扩展名适用于您的用例 (我与此扩展名没有隶属关系) 。This feature is currently not supported. There's a feature-request issue ticket tracking it on VS Code's GitHub repo: Support folding ranges inside a line #50840. You can show your support for the issue ticket by giving a thumbs up reaction to the issue. But please don't make a "me too" comment. "me too" comments generally come off as annoying to repo maintainers because they clutter up discussion and don't contribute anything of significant value.
For now, you can see if the
moalamri.inline-fold
extension suits your use-case (I have no affiliation with this extension).