Fix open path prompt not showing hidden files#46965
Fix open path prompt not showing hidden files#46965SomeoneToIgnore merged 7 commits intozed-industries:mainfrom
Conversation
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
My main concern with the approach is the absence of transparency: how a user is supposed to guess they have to input . first?
What if we return back all show_hidden functionality and always enable that for the path prompt instead?
|
Good point, it isn't very discoverable like this. I did remember at one point Zed had similar behavior so I went back to find the behavior. It looks like it used to in v0.190.0 behave similarly, however it required a I'm happy to add back the 2026-01-22.11-06-23.mp4Commit SHA: |
|
cc @danilo-leal if you have any ideas. I propose to show all by default and alter the tests correspondingly, if Danilo won't propose anything in a week. |
|
#47983 had been merged recently, and it should have changed the way |
The open path prompt will now show hidden files when "." is entered. Also fixes an issue with "open this directory" showing twice when used by the "toolchain: add toolchain" prompt.
Sounds good! I updated the behavior to show the hidden entries by default as well. Just need to fix up the tests now I think. |
|
|
|
Ok all good to go now! |
|
A few more windows-related ones (as those are definitely not dealing with dot-starting hidden files) to fix, and we're good to go! |
…idden`) `Path::file_name()` returns `None` for `.` and `..`, and strips the leading dot from dotfiles. Replace it with manual separator splitting so the suffix is preserved correctly for both Posix and Windows path styles. Also merge the two `cfg`-gated implementations into a single function, since the only difference was Windows separator handling which works on all platforms.
Include the separator character in the dir portion when splitting, rather than stripping it and unconditionally appending `\`. This preserves forward slashes when the user types `C:/root/` style paths.
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Thank you, let's see how this will be recepted, but the change itself looks nice.
Thanks for your review and your patience dealing with those test runs! |
Closes #39036
The open path prompt will now show hidden files when "." is entered. Also fixes an issue with "open this directory" showing twice when used by the "toolchain: add toolchain" prompt.
With a tree of
Before:

After (current directory view without inputting "."):

After (when inputting "." to see hidden entries):

Release Notes: