命名空间中是否有vscode
允许您获取TextDocument
当前打开文件的实例的命令?我找到vscode.workspace.onDidOpenTextDocument
了,但它不适用于启动时打开的文件
问问题
3141 次
1 回答
10
几个选项取决于您的需求:
// Single active editor. Editors have a `.document` property
vscode.window.activeTextEditor
// All showing text editors. For a split view, there are two active editors
vscode.window.visibleTextEditors
// All open documents that vscode knows about. Do not have to be showing
vscode.workspace.textDocuments
有关详细信息,请参阅 vscode API:https ://code.visualstudio.com/docs/extensionAPI/vscode-api
于 2017-07-07T08:35:02.327 回答