【问题标题】:How can I get all TextEditors,which are open at the top of Editor groups?如何获取在编辑器组顶部打开的所有文本编辑器?
【发布时间】:2018-01-12 09:34:40
【问题描述】:

我正在开发一个 VSCode 扩展。我想获取编辑器组顶部选项卡选项卡的所有文本编辑器。我该怎么做?

【问题讨论】:

    标签: visual-studio-code vscode-extensions


    【解决方案1】:

    vscode.window.visibleTextEditors 属性应该有这个

    import * as vscode from 'vscode'
    
    for (const editor of vscode.window.visibleTextEditors) {
        console.log(editor.document.uri)
    }
    

    【讨论】:

    • 我只能通过vscode.window.visibleTextEditors获取当前TextEditor。
    • visibleTextEditor 是位于每个堆栈顶部的一组编辑器:左、中、右。如果您没有看到这种行为,请open an issue
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-09-29
    • 1970-01-01
    • 1970-01-01
    • 2013-11-21
    • 2011-10-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多