V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
pi1ot
V2EX  ›  问与答

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

  •  
  •   pi1ot · 2016-10-27 12:12:09 +08:00 · 4327 次点击
    这是一个创建于 2740 天前的主题,其中的信息可能已经有所发展或是发生改变。
    每次启动 vs code 时都是完全空白,不会恢复上一次关闭时已经打开的文件, window.reopenFolders 已经设置为 all ,但是我一般会同时打开多个目录下的多个文件,这个选项设置为 all 后依然没有效果。
    os:osx , ver:1.6.1
    1 条回复    2016-11-01 16:19:17 +08:00
    pi1ot
        1
    pi1ot  
    OP
       2016-11-01 16:19:17 +08:00
    根本原因是目前 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 发善心
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3432 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:05 · PVG 19:05 · LAX 04:05 · JFK 07:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.