Skip to content

搞英语 → 看世界

翻译英文优质信息和名人推特

Menu
  • 首页
  • 作者列表
  • 独立博客
  • 专业媒体
  • 名人推特
  • 邮件列表
  • 关于本站
Menu

GitHub Copilot 解释代码并将其从一种语言翻译成另一种语言

Posted on 2022-06-08

GitHub Copilot已经是狗屁了,但我刚刚安装了GitHub Labs 扩展程序,我的下巴仍然张开。

代码说明

这个允许您突出显示一段代码并了解它的作用:

截屏视频显示了实际的解释功能

例如:


异步函数 downloadZipFile(downloadUrl) {
等待 fs.remove('out/edge');

常量文件 = fs.createWriteStream(‘edge.zip’);
https.get(downloadUrl, function(response) {
response.pipe(文件);
response.on(‘end’, async ()=>{
等待 fs.createReadStream(‘edge.zip’).pipe(unzipper.Extract({path: ‘out/edge/’}));
等待 fs.unlink(‘edge.zip’, () => {} );
const outdir = path.join(__dirname, ‘out’, ‘edge’);
console.log(`边缘文件提取到:${outdir}`);
});
});
}

变成:

  1. 我们首先删除“out/edge”文件夹。
  2. 我们从 GitHub 发布页面下载 Edge.zip 文件。
  3. 我们将 Edge zip 文件解压缩到“out/edge”文件夹。
  4. 我们向控制台打印一条消息。

代码翻译

您还可以突出显示一段代码,然后将其翻译成另一种语言。例如,JavaScript 到PHP 。

GitHub Copilot 将 JavaScript 转换为 PHP 的截屏视频

我非常期待这一切的进展!

原文: https://christianheilmann.com/2022/06/07/github-copilot-explaining-code-and-translating-it-from-one-language-to-another/

本站文章系自动翻译,站长会周期检查,如果有不当内容,请点此留言,非常感谢。
  • Abhinav
  • Abigail Pain
  • Adam Fortuna
  • Alberto Gallego
  • Alex Wlchan
  • Answer.AI
  • Arne Bahlo
  • Ben Carlson
  • Ben Kuhn
  • Bert Hubert
  • Bits about Money
  • Brian Krebs
  • ByteByteGo
  • Chip Huyen
  • Chips and Cheese
  • Christopher Butler
  • Colin Percival
  • Cool Infographics
  • Dan Sinker
  • David Walsh
  • Dmitry Dolzhenko
  • Dustin Curtis
  • eighty twenty
  • Elad Gil
  • Ellie Huxtable
  • Ethan Dalool
  • Ethan Marcotte
  • Exponential View
  • FAIL Blog
  • Founder Weekly
  • Geoffrey Huntley
  • Geoffrey Litt
  • Greg Mankiw
  • Henrique Dias
  • Hypercritical
  • IEEE Spectrum
  • Investment Talk
  • Jaz
  • Jeff Geerling
  • Jonas Hietala
  • Josh Comeau
  • Lenny Rachitsky
  • Liz Danzico
  • Lou Plummer
  • Luke Wroblewski
  • Matt Baer
  • Matt Stoller
  • Matthias Endler
  • Mert Bulan
  • Mostly metrics
  • News Letter
  • NextDraft
  • Non_Interactive
  • Not Boring
  • One Useful Thing
  • Phil Eaton
  • Product Market Fit
  • Readwise
  • ReedyBear
  • Robert Heaton
  • Rohit Patel
  • Ruben Schade
  • Sage Economics
  • Sam Altman
  • Sam Rose
  • selfh.st
  • Shtetl-Optimized
  • Simon schreibt
  • Slashdot
  • Small Good Things
  • Steve Blank
  • Taylor Troesh
  • Telegram Blog
  • The Macro Compass
  • The Pomp Letter
  • thesephist
  • Thinking Deep & Wide
  • Tim Kellogg
  • Understanding AI
  • Wes Kao
  • 英文媒体
  • 英文推特
  • 英文独立博客
©2025 搞英语 → 看世界 | Design: Newspaperly WordPress Theme