0

For my job i'm frequently opening lists of files from the terminal.

When i do this with vscode, they are opened and all the tabs are there. But only the files i have clicked though and looked at are loaded into memory.

If i were to do a find and replace it would only bring up results from the files i have looked at. It also doesnt tell me how many files are open exactly which would be nice.

These all seem like things other editors do by default.

I was wondering what i have to do to enable this or if any extensions exist to handle it.

Gama11
  • 31,714
  • 9
  • 78
  • 100
lloyd noone
  • 95
  • 10
  • It's probably just a word choice but it's confusing to hear that an editor loads a file into RAM or not (how can you even know that?). What are the exact symptoms? Can you share a screenshot? – Álvaro González Oct 30 '20 at 15:33
  • Ill open, 10 files from terminal. Look at 2 for a quick visual check. Go to do a find and replace and it only shows results from the 2 files i looked at. – lloyd noone Oct 30 '20 at 15:37
  • Do you mean [preview mode](https://stackoverflow.com/questions/38713405/open-files-always-in-a-new-tab)? – Álvaro González Oct 30 '20 at 15:41
  • No, problem that keeps coming up when i try to google this. I have all the files open and all the tabs are there after opening from terminal. Only the ones ive clicked on and looked at will show up in find results. – lloyd noone Oct 30 '20 at 15:43
  • It looks like a bug rather than a configurable behaviour. At least I can't seem to reproduce it in my PC. Does it happen in safe mode? – Álvaro González Oct 30 '20 at 15:47
  • Sorry, should have mentioned i'm on a mac. It's pretty much how it's behaved since i've used it and just thought id finally get the bottom of it. – lloyd noone Oct 30 '20 at 15:53
  • You may want to try `code --disable-extensions` and/or `code --user-data-dir /path/to/some/empty/directory` to at least discard stuff. – Álvaro González Oct 30 '20 at 15:57
  • I found this to be true when creating an extension. I would look for some way to figure out what document tabs were open but tabs aren't actually open when you first open VSCode. You have to look at the tab first. I'm on Windows 10. – boocs Oct 30 '20 at 21:29
  • @boocs we can't be the only 2 people that have noticed this surely haha – lloyd noone Nov 01 '20 at 01:18

1 Answers1

1

It's being worked on to be less 'hacky'.

https://github.com/microsoft/vscode/issues/15178

There is this extension that could maybe work for you:

https://marketplace.visualstudio.com/items?itemName=eamodio.restore-editors

He used a 'hack' to get it to work: https://github.com/microsoft/vscode/issues/15178#issuecomment-283072868

It says he used 'workbench.action.nextEditor' to get it to work but I don't see that, in his code, anymore so he must be using something different now. https://github.com/eamodio/vscode-restore-editors

boocs
  • 456
  • 1
  • 3
  • 5
  • Well that does work. It gets the result i with an extra step i wish wasn't necessary. I'll hold out for a fix but this is good. Thanks! – lloyd noone Nov 01 '20 at 12:19