advanceToCell(document, range) { if (!range || !document) { return; } const textEditor = vscode.window.visibleTextEditors.find(editor => editor.document && editor.document.fileName === document.fileName); if (!textEditor) { return; } // Remember, we use comments to identify cells // Setting the cursor to the comment doesn't make sense // Quirk 1: Besides the document highlighter doesn't kick in (event' not fired), when you have placed the cursor on a comment // Quirk 2: If the first character starts with a %, then for some reason the highlighter doesn't kick in (event' not fired) let firstLineOfCellRange = range; if (range.start.line < range.end.line) { // let line = textEditor.document.lineAt(range.start.line + 1); // let start = new vscode.Position(range.start.line + 1, range.start.character); // firstLineOfCellRange = new vscode.Range(start, range.end); const start = CellHelper.findStartPositionWithCode(document, range.start.line + 1, range.end.line); firstLineOfCellRange = new vscode.Range(start, range.end); } textEditor.selections = []; textEditor.selection = new vscode.Selection(firstLineOfCellRange.start, firstLineOfCellRange.start); textEditor.revealRange(range); vscode.window.showTextDocument(textEditor.document); }
vscode.window.visibleTextEditors.forEach(function (editor, index, array) { if (editor.document == document) { if (!foundEditor) { foundEditor = true; vscode.window.showTextDocument(document, editor.viewColumn); } } });
.then(doc => { if (!doc) { return false; } return vscode_1.window.showTextDocument(doc, vscode_1.window.activeTextEditor ? vscode_1.window.activeTextEditor.viewColumn : undefined) .then(editor => !!editor); }, () => false)
p.on('exit', (code, _signal) => __awaiter(this, void 0, void 0, function* () { if (code === 0) { let document = yield vscode_1.workspace.openTextDocument(tslintConfigFile); vscode_1.window.showTextDocument(document); } else { vscode_1.window.showErrorMessage('Could not run `tslint` to generate a configuration file. Please verify that you have `tslint` and `typescript` installed.'); } }));
vscode.workspace.openTextDocument(consoleLogFile).then(function(d) { vscode.window.showTextDocument(d); // Open file, add console string, save file. var fd = fs.openSync(path + fileName + ".vscodeLog", 'w+'); var buffer = new Buffer(String(data)); fs.writeSync(fd, buffer, 0, buffer.length); fs.close(fd); });
vscode.workspace.openTextDocument(targetFileName).then(function (document) { var foundEditor = false; vscode.window.visibleTextEditors.forEach(function (editor, index, array) { if (editor.document == document) { if (!foundEditor) { foundEditor = true; vscode.window.showTextDocument(document, editor.viewColumn); } } }); if (!foundEditor) { if (vscode.window.activeTextEditor != undefined) { vscode.window.showTextDocument(document, vscode.window.activeTextEditor.viewColumn); } else { vscode.window.showTextDocument(document); } } });
return __awaiter(this, void 0, void 0, function* () { try { if (!pinned) return yield vscode_1.commands.executeCommand(constants_1.BuiltInCommands.Open, uri); const document = yield vscode_1.workspace.openTextDocument(uri); return vscode_1.window.showTextDocument(document, (vscode_1.window.activeTextEditor && vscode_1.window.activeTextEditor.viewColumn) || 1, true); } catch (ex) { return undefined; } });
function showSource(mdUri) { if (!mdUri) { return vscode_1.commands.executeCommand('workbench.action.navigateBack'); } var docUri = vscode_1.Uri.parse(mdUri.query); for (var _i = 0, _a = vscode_1.window.visibleTextEditors; _i < _a.length; _i++) { var editor = _a[_i]; if (editor.document.uri.toString() === docUri.toString()) { return vscode_1.window.showTextDocument(editor.document, editor.viewColumn); } } return vscode_1.workspace.openTextDocument(docUri).then(function (doc) { return vscode_1.window.showTextDocument(doc); }); }
function openOrShowLocation(location) { var lastEditEditorFound = vscode.workspace.textDocuments.find(function(item) { return item.fileName === location.file; }); if (lastEditEditorFound) { vscode.window.showTextDocument(lastEditEditorFound).then(function(editor) { scrollToLocation(editor, location); }); } else { vscode.workspace .openTextDocument(location.file) .then(vscode.window.showTextDocument) .then(function(editor) { scrollToLocation(editor, location); }); } }
prepareSyncDocument.then(function(document) { var showSyncDocument = vscode.window.showTextDocument(document); showSyncDocument.then(function() { var edit = vscode.window.activeTextEditor.edit(function(editBuilder) { editBuilder.delete(new vscode.Range( new vscode.Position(0,0), new vscode.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER) )); }); edit.then(function () { vscode.window.activeTextEditor.edit(function (editBuilder) { editBuilder.insert(new vscode.Position(0, 0), syncJson); }); }); vscode.window.activeTextEditor.document.syncOptions = options; }, function(err) { vscode.window.showErrorMessage("Ftp-sync: sync error: " + err) }) }, function(err) {
return __awaiter(this, void 0, void 0, function* () { let folders = vscode_1.workspace.workspaceFolders; let folder = undefined; if (!folders) { vscode_1.window.showErrorMessage('A TSLint configuration file can only be generated if VS Code is opened on a folder.'); return; } if (folders.length === 1) { folder = folders[0]; } else { const options = { placeHolder: "Select the folder for generating the 'tslint.json' file" }; folder = yield vscode_1.window.showWorkspaceFolderPick(options); if (!folder) { return; } } const folderPath = folder.uri.fsPath; const tslintConfigFile = path.join(folderPath, 'tslint.json'); if (fs.existsSync(tslintConfigFile)) { vscode_1.window.showInformationMessage('A TSLint configuration file already exists.'); let document = yield vscode_1.workspace.openTextDocument(tslintConfigFile); vscode_1.window.showTextDocument(document); } else { const tslintCmd = yield findTslint(folderPath); const cmd = `${tslintCmd} --init`; const p = child_process_1.exec(cmd, { cwd: folderPath, env: process.env }); p.on('exit', (code, _signal) => __awaiter(this, void 0, void 0, function* () { if (code === 0) { let document = yield vscode_1.workspace.openTextDocument(tslintConfigFile); vscode_1.window.showTextDocument(document); } else { vscode_1.window.showErrorMessage('Could not run `tslint` to generate a configuration file. Please verify that you have `tslint` and `typescript` installed.'); } })); } });
async function configure(actionContext, rootFolderPath) { if (!rootFolderPath) { let folder = await quickPickWorkspaceFolder_1.quickPickWorkspaceFolder('To generate Docker files you must first open a folder or workspace in VS Code.'); rootFolderPath = folder.uri.fsPath; } let filesWritten = await configureCore(actionContext, { rootPath: rootFolderPath, outputFolder: rootFolderPath, openDockerFile: true }); // Open the dockerfile (if written) try { let dockerfile = filesWritten.find(fp => path.basename(fp).toLowerCase() === 'dockerfile'); if (dockerfile) { await vscode.window.showTextDocument(vscode.Uri.file(dockerfile)); } } catch (err) { // Ignore } }
vscode.workspace.openTextDocument(getProjectFilePath()).then(function (doc) { vscode.window.showTextDocument(doc); });
vscode.workspace.openTextDocument(ftpconfig.getConfigPath()).then(document => { vscode.window.showTextDocument(document); });
vscode.workspace.openTextDocument(path.join(dir, file)).then(document => { vscode.window.showTextDocument(document); });
vscode.workspace.openTextDocument(configUri).then( function(document) {vscode.window.showTextDocument(document)});
configDocument.then(function(document) { vscode.window.showTextDocument(document); });
.then(function () { vscode_1.window.showTextDocument(activeTextEditor.document, activeTextEditor.viewColumn); activeTextEditor.selection = new vscode_1.Selection(activeTextEditor.selection.start, activeTextEditor.selection.start); return Promise.resolve(true); });
vscode.workspace.openTextDocument(tmpFilePath).then(function (d) { vscode.window.showTextDocument(d); resolve(tmpFilePath); });
vscode.workspace.openTextDocument(filePath_1).then(function (document) { vscode.window.showTextDocument(document); });
showTextDocument(uri, options, preserveFocus) { return vscode_1.window.showTextDocument(uri, options, preserveFocus); }
vscode.workspace.openTextDocument(nextDocument.toString()).then(function (doc) { vscode.window.showTextDocument(doc).then(function (editor) { // revealLine(activeBookmark.bookmarks[0]); revealLine(bookmarks.activeBookmark.bookmarks[bookmarks.activeBookmark.bookmarks.length - 1]); }); });
vscode.workspace.openTextDocument(uriDocument).then(function (doc) { vscode.window.showTextDocument(doc, undefined, true).then(function (editor) { revealLine(parseInt(item.label, 10) - 1); }); });
vscode.workspace.openTextDocument(uriDocument).then(function (doc) { vscode.window.showTextDocument(doc).then(function (editor) { revealLine(currentLine - 1); return; }); });
vscode.workspace.openTextDocument(p).then(function (doc) { vscode.window.showTextDocument(doc, column).then(function(){ if(cb) cb(); }); });
vscode.workspace.openTextDocument(filePath).then(doc => { vscode.window.showTextDocument(doc).then( postDocOpenFn , reason => { console.log(reason); } ); }, reason => { console.log(reason); }
vscode.workspace.openTextDocument(this.propertiesFile).then(function (document) { vscode.window.showTextDocument(document); });
return __awaiter(this, void 0, void 0, function* () { const imageName = image.RepoTags ? image.RepoTags[0] : image.Id; const uri = vscode_1.Uri.parse(`${exports.SCHEME}://${exports.IMAGE_DOMAIN}/${imageName}${exports.URI_EXTENSION}`); vscode_1.window.showTextDocument(yield vscode_1.workspace.openTextDocument(uri)); });
vscode.workspace.openTextDocument(tmpFile).then(d => { vscode.window.showTextDocument(d); vscode.commands.executeCommand("workbench.files.action.compareFileWith"); vscode.window.showTextDocument(doc); resolve(p4uri); }, (reason) => {console.log(reason);});
vscode.workspace.openTextDocument(uriDocument).then(function (doc) { vscode.window.showTextDocument(doc).then(function (editor) { revealLine(parseInt(selection.label, 10) - 1); }); });