英文:
It's hard to create files/folders at the root of the VS Code workspace. Is it possible to add more space to the bottom of the Explorer View?
问题
我有很多文件夹和东西在我的Python文件夹中。我如何使得在资源管理器视图的树列表底部有固定的空间,即使会导致溢出,从而创建一个滚动条?截图。
英文:
I have a lot of folders and things in my python folder. How do I make it so that there is a fixed amount of space at the bottom of the Explorer View's treelist, even if it would cause overflow when there otherwise wouldn't be, creating a scrollbar? screenshot.
答案1
得分: 1
奇怪的是,这应该已经是原始的VS Code的一部分了。请参见Test: top level resource creation in explorer #79800,该问题是为了解决类似Difficult to create folder in left panel file view if the open folder only contains folder #1043的问题而创建的(几乎完全是你描述的问题)。我猜这个改变的一部分出现了问题。我已经在一个问题票中提出了这个回归问题,票号为The additionalScrollHeight
part of #79800 seems to have regressed #190092。我的问题票实际上可能是File list margin is gone in 1.81 #189809的重复,这表明这是一个非常近期的回归(VS Code的1.81版本),可能是由Pull Request #178627引起的。该问题的修复已在commit a0377f0
中完成,计划在2023年8月的VS Code发布中发布。
至于你的根目标-在工作区文件夹的根目录创建文件或文件夹,是的,我理解你的痛苦。资源管理器视图顶部按钮的默认行为是在当前选定的文件的同级创建项目(如果选定了文件),或在当前选定的目录下创建项目(如果选定了目录)。好消息是,在#79800中进行的其他更改仍然有效,包括允许你按<kbd>esc</kbd>取消对列表项的焦点,并将焦点放在整个列表上(然后可以使用资源管理器视图顶部的新文件/文件夹操作按钮在树的根目录创建文件/文件夹),所以你可以暂时使用这个方法解决问题。
还有一个相关的问题票:"New file" / "New folder" on file context menu #83693,在那个问题票中,它被关闭为不计划实现,并建议通过扩展来实现,在该讨论中,wenfangdu.faster-new
被列为一个这样的扩展<sup><sub>(我与该扩展没有任何关联)</sub></sup>。
英文:
Strangely, this is supposed to already be part of vanilla VS Code. See Test: top level resource creation in explorer #79800, which was created as the solution to issue tickets like Difficult to create folder in left panel file view if the open folder only contains folder #1043 (pretty much exactly the problem you are describing). I guess that part of that change regressed. I've raised the regression in an issue ticket at The additionalScrollHeight
part of #79800 seems to have regressed #190092. My issue ticket is actually probably a duplicate of File list margin is gone in 1.81 #189809, which would indicate that this is a very recent regression (version 1.81 of VS Code), likely caused by Pull Request #178627. The fix for the issue was made in commit a0377f0
, which is scheduled for release in the August 2023 release of VS Code.
As for what your root goal is- to create files or folders at the root of the workspace folder, yeah, I feel your pain. The default behaviour of the buttons at the top of the Explorer View create things at the same level of the currently selected file (if a file is selected), or under the currently selected directory (if a directory is selected). On the bright side, the other changes made and which were under test in #79800 including allowing you to press <kbd>esc</kbd> to unfocus list items and put focus on the listing as a whole (which then allows you to use the new file/folder action buttons at the top of the Explorer View to create a file/folder at the root of the tree) still works, so you can use that as a workaround for now.
There's also a related issue ticket: "New file" / "New folder" on file context menu #83693 where it's closed as not planned, and preferred for implementation via extensions, where in that thread, wenfangdu.faster-new
is listed as one such extension <sup><sub>(I have no affiliation with this extension)</sub></sup>.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论