-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show quick open results as preview while navigating through them #8939
Comments
I myself have been wanting this very same thing. I tend to open several files up front, and then I have to double-click each one. I think that opening something via Quick Open as a fully-opened file makes sense in this case, because if you had the opportunity to see a preview and still committed via enter or a click to open it then you probably intend to keep it around for a while. |
Just to be clear, the point of this is to see the contents of a file as I scroll through the results of Quick Open. As far as permanently opening a file from quick open, that would be good too. |
Previewing files as you move up and down the list of results makes a lot of sense. For files that are currently open we would bring them to the front. |
UX meeting notes
Bold = addition |
I'm glad I found this issue (under this not-so-much clear title), so I don't have to create it myself. I just got annoyed by this behaviour of closing files - I evidently wanted to have opened - for the 451th time in the last two weeks. Please, let's make it into the next release. :) |
Ive spent some time working through this. Have a good understanding of the organization of the editorPart, groups, stack model, etc. Pushing up a PR, but I'd really like to fix some UX issues below.
I think a better UX would be to close a preview editor if there were none open. Hitting escape should remove all side effects e.g. opening a new preview editor.
Would we prefer to honor the user preference |
Another UX issue that I discovered while previewing in a current We could keep track of a selection/cursor when opening with Thoughts? |
Sublime preserves the cursor position of each file, and when you preview that file, it shows the cursor in that position. If you haven't visited that file before, it defaults to the top of the file. |
actually, they use a brand new editor buffer when displaying a file that has no editor associated with it. otherwise, you're effectively just swapping the viewable editors (VS Code also will preserve line and viewport position in this respect). this is what Im doing now in my PR. Im lobbying for a new buffer with no tab, so we can have a similar experience to what ST has. |
Also, Sublime will put focus on an open tab if what you have selected in Quick View is already open. |
yeah, see my PR. these behaviors are implemented. :) |
@wprater yes, the preview editor has to go away when I cancel my quick open session without picking an item. I cannot see how the scroll positions can get lost unless you actually provide options with line/col information. We always persist the view state of the editor and restore it on open unless you provide your own view state. |
The issue is that I need to render another temporary editor and display it as an Do you know of a method in which I could create such an editor? I can keep looking around, but if there are some mechanics already, I'd like to utilize them. |
@wprater I do not understand why you would want to open a temporary editor... |
Might make it easier around the logic of maintaining when a new preview editor was opened or not. As well as the issue Im having when previewing in the preview editor, where the new files seem to be opened at the final line, vs. the top of file (they were not previously opened.) If you did not have a preview editor open and the eager preview display opened an editor, then when cancelling, Im not certain how rest the editor group's state of active/preview editors. |
Whatever we end up doing, you cannot open a "preview editor", it can only be the file imho. I think in order to restore the previous state you probably have to capture it and restore it. As for opening on first line, you can pass options for the open to have it open at line/col 1. it is interesting if that is the desired behaviour though. |
Maybe my nomenclature is a bit off. I believe the current PR follows suit to the UX meetings notes. However, I would prefer we not allow any side effect when cancelling out of a quick open widget. If you agree, I need to determine if a new preview editor was opened when not one presently. If there was not one open, I need to be sure to close the preview editor that was created to preview the focused items in the tree. I'll look into that again tomorrow. I don't desire to have them open on the first line/col, unless the file was not already present in an editor buffer. If I continually swap the preview editors, I was seeing many of my files loaded into the preview on the last line. The other files editors that are selected seem to work great! |
Ok I think I was confused by terms here. We agree on this behaviour:
|
gt |
@TylerLeonhardt, Which dialog is that? It looks like a different dialog than the "quick open, go to file" (Crtl/CMD-p) which the OP seems to indicate in step 2:
|
@dpidan I think the screenshot is referring to one of VSCode apis. |
@dpidan it's Intellisense in an editor... that has items, with additional context, and is keyboard driven. |
While we wait for this feature, this extension FindItFaster does a pretty good job. It would be great if we get this built-in. |
7 years later and counting ⏳ 😄 |
It will be amazing to have fzf with that preview build in to VsCode. |
Dear Diary, :( |
I'd pay for that feature. I really miss it. |
FindIt Faster is quite good, it creates a new terminal in order to run rg/fzf/bat ... not quite the experience of a floating pane, like telescope.nvim, but it's quite good thinking about it, i don't think vscode has centered floating panes, they all are attached to the top (such as the control panel) |
This feature is missing so much... PLEEEEESEEE |
I made a little extension 🫧 Periscope last year to give me an experience as close as possible whilst constrained by the existing vscode UI primitives. It's evolved a bit to lean in to ripgrep but its remained my daily driver for grepping across the workspace. Might be useful to some of you! ✌️ |
@joshmu this kinda looks like the built-in "Quick Search" feature that VSCode has been iterating on for the past few releases, no? https://code.visualstudio.com/updates/v1_88#_quick-search-improvements |
however, there's no quick preview, i would guess it's because of the limitations with the vscode ui primitives, as @joshmu mentioned that telescope.nvim ui is wicked, i'm seriously considering nvim |
@jbrodriguez not sure what you mean. As you arrow-through the results using VSCode's Quick Search, the currently-focused editor shows you a preview of that result in the file where it exists. Seems the same as the video in the extension I was replying to. |
you're right, yes, not as straightforward, but does the job |
@macintacos the Quick Search (experimental) is similar to Periscope in regards to file previews as you navigate across results. The biggest difference would be that Periscope provides access to more of ripgrep. eg: pattern matching, file type & sub folder filtering, etc. You can personalise this to your needs and create abbreviations for your common searches. If there is no interest in those type of advanced grep features then Quick Search would be sufficient |
@macintacos but the quicksearch feature which you mention, does not work when you go to "open file" search dialogue or? Just for full text seach, not for file search. |
@h0jeZvgoxFepBQ2C right. I wasn't saying that that feature in VSCode takes care of this issue. I was just saying that that feature is very similar to the Periscope extension that was linked to earlier in the thread. I don't think that the issue described in the original description is "solved", by any means. |
Would love to have this feature in the editor picker (when you press Ctrl+Tab) too. |
Any news from the dev team on this ? A built in telescope in vscode would make the programming experience soo much better... |
Can anyone help me with this? I've managed to create something similar with a simple script, but I'm unsure how to retrieve the file name from the dropdown menu and display the corresponding content. Currently, I'm trying to build a proxy server, use a VSCode plugin to send UDP packets, and have my script receive those packets to display the content. However, it's becoming quite complicated. Is there a simpler way to achieve this? |
Bump, still waiting ;) |
Hi @Alan-MQ would you make this open? Looks like you got to an interesting point and i would love to take a look and see if i can help in anyway since i am really looking for this feature in VScode and it's the reason why i am still not switching from nvim to vscode. |
yeah , sure I've updated that comment, check it out, and feel free to let me know if I missed something~~ |
It would indeed be very useful to automatically show the preview of a searched file. Are there any chances of this being prioritized any time soon @TylerLeonhardt? :) |
https://github.com/jpcrs/binocular Might be a good workaround if you can get it to work. I wasn't having any luck on Windows, despite having all the dependencies. |
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: