本文整理匯總了TypeScript中vscode.window.showTextDocument方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript window.showTextDocument方法的具體用法?TypeScript window.showTextDocument怎麽用?TypeScript window.showTextDocument使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vscode.window
的用法示例。
在下文中一共展示了window.showTextDocument方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
.then((doc: vscode.TextDocument) => {
textDoc = doc;
return vscode.window.showTextDocument(doc)
})
示例2:
}).then((doc) => {
return window.showTextDocument(doc, ViewColumn.One);
}).then(() => {
示例3:
Workspace.openTextDocument(path).then((document) => {
Window.showTextDocument(document);
});
示例4:
vscode.workspace.openTextDocument(fileEncodingUsed).then(document => {
textDocument = document;
return vscode.window.showTextDocument(textDocument);
}).then(editor => {
示例5: openFile
async function openFile(fileName: string) {
const document = await vscode.workspace.openTextDocument(fileName);
const editor = await vscode.window.showTextDocument(document);
assert(vscode.window.activeTextEditor, 'No active editor');
return editor;
}
示例6:
return vscode.workspace.openTextDocument(filePath).then(document => {
return vscode.window.showTextDocument(document, vscode.ViewColumn.Three);
});
示例7:
return vscode.workspace.openTextDocument(fileToFormatWithoutConfig).then(document => {
textDocument = document;
originalContent = textDocument.getText();
return vscode.window.showTextDocument(textDocument);
}).then(editor => {
示例8:
openDocument.then((document:TextDocument) =>
{
window.showTextDocument(document);
});
示例9: openDocument
async function openDocument() {
const uri = Uri.file(editorFile1);
const textDocument = await workspace.openTextDocument(uri);
return window.showTextDocument(textDocument);
}