pi1ot
V2EX  ›  问与答

visual studio code 怎么在每次启动时恢复之前已经打开的文件?

  •  
  •   pi1ot · Oct 27, 2016 · 5010 views
    This topic created in 3491 days ago, the information mentioned may be changed or developed.
    每次启动 vs code 时都是完全空白,不会恢复上一次关闭时已经打开的文件, window.reopenFolders 已经设置为 all ,但是我一般会同时打开多个目录下的多个文件,这个选项设置为 all 后依然没有效果。
    os:osx , ver:1.6.1
    1 replies    2016-11-01 16:19:17 +08:00
    pi1ot
        1
    pi1ot  
    OP
       Nov 1, 2016
    根本原因是目前 vscode 不记录非 workspace 状态下的编辑器状态,包括非 workspace/folder 模式下打开的文件,虽然有很多人在提交相关的需求但是目前还未列入规划

    比如: Store workspace UI state also for empty workspaces · Issue #4429 · Microsoft/vscode · GitHub

    然后我尝试使用 extension 实现,但是因为 vscode 的 extensin api 目前仅提供 workspace 状态下的 texteditor 遍历接口和 open/close 事件监控接口,无法获知非 workspace/folder 模式下打开的文件列表和状态,所以无法通过扩展实现

    暂时只能静等 ms 发善心
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3937 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 00:56 · PVG 08:56 · LAX 17:56 · JFK 20:56
    ♥ Do have faith in what you're doing.