Skip to content
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

Limitations of Source Archive file systems #500

Open
jcreedcmu opened this issue Jul 15, 2020 · 3 comments
Open

Limitations of Source Archive file systems #500

jcreedcmu opened this issue Jul 15, 2020 · 3 comments
Labels
bug Something isn't working VSCode

Comments

@jcreedcmu
Copy link
Contributor

jcreedcmu commented Jul 15, 2020

To Reproduce
Import a database with a zipped archive. Open some file on disk outside the source archive. Select various source files in the source archive. Do VS Code command palette "Go Back"

Expected behavior
The previously viewed file is shown.

Actual behavior
The most recently viewed file outside the source archive is shown.

Additional context
Users have reported that this bug doesn't consistently reproduce, and sometimes Go Back and Go Forward is broken even for normal files. A workaround is making the source archive file a non-preview editor, for example by double clicking on it in the file explorer.

Note that this is just one manifestation of the bug. For more context see #500 (comment) below.

@jcreedcmu jcreedcmu added the bug Something isn't working label Jul 15, 2020
@aeisenberg
Copy link
Contributor

aeisenberg commented Jul 17, 2020

Here's how I can reliably reproduce:

  1. Close all editors except for editor A
  2. Open an archive file B in a preview editor
  3. Open a different archive file C in a preview editor
  4. run the Go Back command

Expected: navigates to location in B.

Actual: navigates to A.

Note that if B is converted to non-preview, then navigation happens as expected.

@aeisenberg
Copy link
Contributor

My thinking is that this is a vscode bug. I can't see any code path that history navigation takes through our code. I would think it's in archive-filesystem-provider.ts, but no breakpoints are reached when Go Back is invoked.

@aeisenberg
Copy link
Contributor

Based on some prompting by @p0, I did a deeper dive into this issue. There are currently three limitations that we know of regarding vscode FileSystemProviders.

  1. Code navigation locations are not recorded in history if the file is from a provider and the file was only opened in a preview editor. Navigation locations are removed if an editor for the file is closed Allow file system provider schemes to participate in history even after close microsoft/vscode#108935
  2. Find in files command does not find text in files from providers. Stabilize TextSearchProvider API microsoft/vscode#59921
  3. Open file command does not include files from providers. Stabilize FileSearchProvider API microsoft/vscode#73524

As a further example, you can see the same limitations when using the sample MemFS file system provider.

To mitigate #1, we could always open archive files in non-preview mode when navigating from a results view. This would mitigate the problem, not fix it since if the editor is ever closed, we lose navigation history for it.

@aeisenberg aeisenberg changed the title Code navigation history doesn't work reliably with source archives Limitations of Source Archive file systems Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working VSCode
Projects
None yet
Development

No branches or pull requests

3 participants