{"id":1610,"date":"2024-04-11T13:19:42","date_gmt":"2024-04-11T13:19:42","guid":{"rendered":"https:\/\/howtogeek.blog\/zh\/?p=1610"},"modified":"2024-04-11T13:19:42","modified_gmt":"2024-04-11T13:19:42","slug":"how-to-use-gemini-code-assist-in-vs-code-zh-tw","status":"publish","type":"post","link":"https:\/\/howtogeek.blog\/zh\/how-to-use-gemini-code-assist-in-vs-code-zh-tw\/","title":{"rendered":"\u5982\u4f55\u5728 VS Code \u4e2d\u4f7f\u7528 Gemini Code Assist"},"content":{"rendered":"<p>Google\u6700\u8fd1\u5728\u62c9\u65af\u7dad\u52a0\u65af\u8209\u884c\u7684 Cloud Next \u6703\u8b70\u4e0a\u63a8\u51fa\u4e86 Gemini Code Assist\uff0c\u9019\u662f\u4e00\u6b3e\u4ee5\u4f01\u696d\u70ba\u5c0e\u5411\u7684\u4eba\u5de5\u667a\u6167\u7a0b\u5f0f\u78bc\u5b8c\u6210\u548c\u8f14\u52a9\u5de5\u5177\u3002<\/p>\n<p><strong>\u4ec0\u9ebc\u662f Gemini \u7a0b\u5f0f\u78bc\u5354\u52a9\uff1f<\/strong>\u60a8\u53ef\u4ee5\u5728 IDE\uff08\u4f8b\u5982 VS Code\u3001IntelliJ\u3001Cloud Workstations \u6216 Cloud Shell Editor\uff09\u4e2d\u4f7f\u7528 Gemini Code Assist \u4f86\u5354\u52a9\u958b\u767c\uff0c\u6216\u5728 Google Cloud Console \u4e2d\u4f7f\u7528\u5b83\u4f86\u8f14\u52a9\u6545\u969c\u6392\u9664\u3002<\/p>\n<p>Gemini Code Assist \u53ef\u4ee5\u5e6b\u52a9\u60a8\u5728\u7de8\u5beb\u7a0b\u5f0f\u78bc\u6642\u5b8c\u6210\u7a0b\u5f0f\u78bc\uff0c\u5f9e\u8a3b\u89e3\u7522\u751f\u5b8c\u6574\u7684\u51fd\u6578\u6216\u7a0b\u5f0f\u78bc\u5340\u584a\uff0c\u7522\u751f\u55ae\u5143\u6e2c\u8a66\uff0c\u4e26\u5354\u52a9\u60a8\u5075\u932f\u3001\u7406\u89e3\u548c\u8a18\u9304\u7a0b\u5f0f\u78bc\u3002<\/p>\n<p>\u5f9e\u6280\u8853\u4e0a\u8b1b\uff0c\u5b83\u662f Duet AI \u7684\u6f14\u8b8a\uff0c\u8c37\u6b4c\u5e7e\u500b\u6708\u524d\u505c\u6b62\u4e86 Duet AI\u3002\u7136\u800c\uff0c\u73fe\u5728\uff0c\u5b83\u66f4\u50cf\u662f\u5fae\u8edf GitHub Copilot \u7684\u76f4\u63a5\u7af6\u722d\u5c0d\u624b\uff0c\u5f8c\u8005\u662f\u53ef\u4ee5\u5e6b\u52a9\u60a8\u7de8\u78bc\u7684\u6700\u8457\u540d\u7684\u4eba\u5de5\u667a\u6167\u5de5\u5177\u4e4b\u4e00\u3002<\/p>\n<p>Code Assist \u4f7f\u7528 Gemini 1.5 Pro\uff0c\u5b83\u64c1\u6709 100 \u842c\u500b\u4e0a\u4e0b\u6587\u7a97\u53e3\uff0c\u662f\u6240\u6709\u6a21\u578b\u63d0\u4f9b\u7684\u6700\u5927\u4e0a\u4e0b\u6587\u7a97\u53e3\u3002\u9019\u7d66 Code Assist \u5e36\u4f86\u4e86\u76f8\u7576\u5927\u7684\u512a\u52e2\u3002\u7528\u6236\u751a\u81f3\u53ef\u4ee5\u4f7f\u7528\u6b64\u4e0a\u4e0b\u6587\u8996\u7a97\u5c0d\u5176\u6574\u500b\u7a0b\u5f0f\u78bc\u5eab\u9032\u884c\u66f4\u6539\uff0c\u9019\u662f\u76ee\u524d\u5176\u4ed6\u5e73\u53f0\u7121\u6cd5\u63d0\u4f9b\u7684\u3002<\/p>\n<p>\u516c\u53f8\u9084\u53ef\u4ee5\u6839\u64da\u5176\u5167\u90e8\u7a0b\u5f0f\u78bc\u5eab\u5fae\u8abf Code Assist\uff0c\u5c31\u50cf GitHub Copilot \u4e00\u6a23\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u5728 2024 \u5e74 7 \u6708 11 \u65e5\u4e4b\u524d\u514d\u8cbb\u8a66\u7528 Gemini Code Assist\uff0c\u6bcf\u500b\u8a08\u8cbb\u5e33\u6236\u50c5\u9650\u4e00\u540d\u4f7f\u7528\u8005\u3002<\/p>\n<p>\u5728\u672c\u6307\u5357\u4e2d\uff0c\u6211\u5011\u5c07\u91cd\u9ede\u653e\u5728\u5982\u4f55\u5728 Visual Studio (VS) Code \u4e2d\u4f7f\u7528 Gemini Code Assist\u3002<\/p>\n<h2 id=\"setting-up-gemini-code-assist-with-vs-code\">\u4f7f\u7528 VS Code \u8a2d\u5b9a Gemini Code Assist<\/h2>\n<p>\u8981\u5c07 Code Assist \u8207 VS Code \u7d50\u5408\u4f7f\u7528\uff0c\u60a8\u9700\u8981\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u4f86\u8a2d\u5b9a\u6574\u500b\u5167\u5bb9\u3002<\/p>\n<h3 id=\"install-cloud-code-extension\">\u5b89\u88dd\u96f2\u7aef\u4ee3\u78bc\u64f4\u5145<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88dd Cloud Code \u64f4\u5145\u529f\u80fd\u624d\u80fd\u5c07 Code Assist \u8207 VS Code \u7d50\u5408\u4f7f\u7528\u3002<\/p>\n<ul>\n<li>\u5728\u60a8\u7684\u96fb\u8166\u4e0a\u958b\u555f VS Code\u3002<\/li>\n<li>\u7136\u5f8c\uff0c\u5f9e\u5de6\u5074\u9078\u55ae\u8f49\u5230\u201c\u64f4\u5c55\u201d\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"593\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-78-1-1.webp\" title=\"\" width=\"1054\"\/><\/figure>\n<ul>\n<li>\u4f7f\u7528\u641c\u5c0b\u6b04\u641c\u5c0b\u201c\u96f2\u7aef\u4ee3\u78bc\u201d\u3002\u9ede\u9078\u7b2c\u4e00\u500b\u641c\u5c0b\u7d50\u679c\uff0c\u5373Gemini + Google Cloud Code\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"551\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-79-1-1.webp\" title=\"\" width=\"979\"\/><\/figure>\n<ul>\n<li>\u7136\u5f8c\uff0c\u9ede\u64ca\u201c\u5b89\u88dd\u201d\u6309\u9215\u4e26\u5b89\u88dd\u64f4\u5145\u529f\u80fd\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"593\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-81-1-1.webp\" title=\"\" width=\"1054\"\/><\/figure>\n<p>Cloud Code \u64f4\u5145\u529f\u80fd\u73fe\u5df2\u5b89\u88dd\u5728 VS Code \u4e0a\u3002\u5b83\u6700\u9069\u7528\u65bc\u4ee5\u4e0b\u8a9e\u8a00\uff1a<\/p>\n<ul>\n<li>NodeJS<\/li>\n<li>\u53bb<\/li>\n<li>Python<\/li>\n<li>\u722a\u54c7<\/li>\n<li>\u3002\u7db2<\/li>\n<\/ul>\n<p>\u96d6\u7136 NodeJS \u5728 VS Code \u4e2d\u5177\u6709\u5167\u5efa\u652f\u63f4\u4e26\u4e14\u4e0d\u9700\u8981\u984d\u5916\u7684\u64cd\u4f5c\uff0c\u4f46\u5982\u679c\u60a8\u60f3\u4f7f\u7528\u5176\u4ed6\u8a9e\u8a00\uff0c\u5247\u9700\u8981\u5b89\u88dd\u5b83\u5011\u3002\u60a8\u53ef\u4ee5\u50cf\u5b89\u88dd Cloud Code \u64f4\u5145\u529f\u80fd\u4e00\u6a23\u5b89\u88dd\u9019\u4e9b\u8a9e\u8a00\u3002<\/p>\n<p>\u6216\u8005\uff0c\u5982\u679c\u60a8\u60f3\u8981\u5c07\u7bc4\u4f8b\u8907\u88fd\u5230\u60a8\u7684\u8a08\u7b97\u6a5f\uff0c\u60a8\u9084\u9700\u8981\u5b89\u88dd Git\u3002<\/p>\n<h3 id=\"connect-to-google-cloud\">\u9023\u63a5\u5230\u8c37\u6b4c\u96f2<\/h3>\n<p>\u73fe\u5728\uff0c\u4e0b\u4e00\u6b65\u6d89\u53ca\u5f9e VS Code \u9023\u63a5\u5230 Google Cloud\u3002<\/p>\n<ul>\n<li>\u5b89\u88dd\u64f4\u5145\u529f\u80fd\u5f8c\uff0c\u6309\u4e00\u4e0b\u300c\u958b\u555f\u6f14\u7df4\u300d\u9078\u9805\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"618\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-82-1-1.webp\" title=\"\" width=\"1098\"\/><\/figure>\n<ul>\n<li>\u9ede\u9078\u300c\u9023\u63a5 Google Cloud\u300d\u9078\u9805\u4e0a\u7684\u300c\u9023\u7dda\u300d\u6309\u9215\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"546\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-83-1-1.webp\" title=\"\" width=\"970\"\/><\/figure>\n<ul>\n<li>\u5c07\u51fa\u73fe\u4e00\u5247\u8a0a\u606f\uff0c\u6307\u51fa VS Code \u8981\u958b\u555f\u5916\u90e8\u7db2\u7ad9\u3002\u9ede\u9078\u201c\u958b\u555f\u201d\u7e7c\u7e8c\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"582\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-84-1-1.webp\" title=\"\" width=\"1034\"\/><\/figure>\n<ul>\n<li>\u7136\u5f8c\uff0c\u767b\u5165\u60a8\u7684 Google \u5e33\u6236\u3002<\/li>\n<li>\u63a5\u4e0b\u4f86\uff0c\u60a8\u7684Google\u5e33\u6236\u6703\u8981\u6c42\u60a8\u78ba\u4fdd\u60a8\u5f9eGoogle\u4e0b\u8f09\u4e86\u6b64\u61c9\u7528\u7a0b\u5f0f[Cloud Code]\uff1b\u9ede\u64ca\u201c\u767b\u5165\u201d\u7e7c\u7e8c\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"607\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-85-1-1.webp\" title=\"\" width=\"1078\"\/><\/figure>\n<p>\u60a8\u7684\u5e33\u6236\u73fe\u5df2\u9023\u63a5\u5230 Google Cloud\u3002<\/p>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u900f\u904e\u9078\u64c7\u555f\u7528\u4e86 Cloud API \u7684 Google Cloud \u5c08\u6848\u4f86\u5728 VS Code \u4e2d\u555f\u52d5 Gemini\u3002\u4f46\u662f\uff0c\u5982\u679c\u60a8\u5230\u76ee\u524d\u70ba\u6b62\u5c1a\u672a\u8a3b\u518a Google Cloud\uff0c\u5247\u9996\u5148\u9700\u8981\u8a3b\u518a\u3002<\/p>\n<h3 id=\"sign-up-for-google-cloud\">\u8a3b\u518a Google \u96f2<\/h3>\n<p>\u5982\u679c\u60a8\u6c92\u6709 Google Cloud\uff0c\u5247\u53ef\u4ee5\u4f7f\u7528 300 \u7f8e\u5143\u7684\u7a4d\u5206\u514d\u8cbb\u8a66\u7528 3 \u500b\u6708\u3002<\/p>\n<ul>\n<li>\u9020\u8a2a cloud.google.com \u4e26\u9ede\u64ca\u300c\u514d\u8cbb\u958b\u59cb\u300d\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"612\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-86-1-1.webp\" title=\"\" width=\"1088\"\/><\/figure>\n<ul>\n<li>\u7136\u5f8c\uff0c\u63d0\u4f9b\u60a8\u7684\u5e33\u6236\u8cc7\u8a0a\u4e26\u9ede\u64ca\u300c\u540c\u610f\u4e26\u7e7c\u7e8c\u300d\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"667\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-87-1-1.webp\" title=\"\" width=\"1186\"\/><\/figure>\n<ul>\n<li>\u63d0\u4f9b\u60a8\u7684\u4ed8\u6b3e\u4fe1\u606f\uff0c\u7136\u5f8c\u9ede\u64ca\u201c\u958b\u59cb\u514d\u8cbb\u201d\u4ee5\u7372\u5f97\u514d\u8cbb\u8a66\u7528\u3002\u8a66\u7528\u7d50\u675f\u5f8c\uff0c\u9664\u975e\u60a8\u624b\u52d5\u555f\u52d5\u5b8c\u6574\u7684 Google Cloud \u5e33\u865f\uff0c\u5426\u5247\u6211\u5011\u4e0d\u6703\u5411\u60a8\u6536\u53d6\u8cbb\u7528\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"745\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-88-1-1.webp\" title=\"\" width=\"1324\"\/><\/figure>\n<p>\u64c1\u6709 Google Cloud \u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5176\u4e2d\u7684\u5c08\u6848\u5728 VS Code \u4e2d\u4f7f\u7528 Gemini\u3002<\/p>\n<h3 id=\"activate-gemini-in-vs-code\">\u5728 VS Code \u4e2d\u555f\u52d5 Gemini<\/h3>\n<ul>\n<li>\u73fe\u5728\uff0c\u8fd4\u56de VS Code \u4e26\u9ede\u64ca\u300c\u9078\u64c7 Google Cloud \u5c08\u6848\u300d\u4ee5\u555f\u52d5 Gemini\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"574\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-89-1-1.webp\" title=\"\" width=\"1020\"\/><\/figure>\n<ul>\n<li>\u9078\u64c7 Google Cloud \u9805\u76ee\u7684\u9078\u9805\u5c07\u51fa\u73fe\u5728\u9802\u90e8\u3002\u9078\u64c7\u555f\u7528\u4e86 Cloud API \u7684 Google Cloud \u5c08\u6848\u3002\u60a8\u4e5f\u53ef\u4ee5\u5efa\u7acb\u65b0\u7684 Google Cloud \u5c08\u6848\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"575\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-90-1.webp\" title=\"\" width=\"1023\"\/><\/figure>\n<ul>\n<li>\u5982\u679c\u60a8\u6240\u9078\u7684\u9805\u76ee\u672a\u555f\u7528 Cloud API\uff0c\u60a8\u5c07\u5728 VS Code \u8996\u7a97\u4e2d\u6536\u5230\u932f\u8aa4\u8a0a\u606f\u3002\u9ede\u64ca\u201c\u555f\u7528 API\u201d\u5373\u53ef\u4fee\u5fa9\u8a72\u554f\u984c\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"541\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-91-1.webp\" title=\"\" width=\"963\"\/><\/figure>\n<ul>\n<li>Gemini \u5c07\u555f\u52d5\u4ee5\u5728 VS Code \u4e2d\u4f7f\u7528\u3002\u60a8\u53ef\u4ee5\u96a8\u6642\u5f9e\u72c0\u614b\u5217\u5b58\u53d6\u5b83\uff0c\u72c0\u614b\u5217\u73fe\u5728\u5c07\u986f\u793a\u5df2\u555f\u52d5\u7684 Gemini\uff0c\u800c\u4e0d\u662f\u5148\u524d\u505c\u7528\u7684 Gemini \u5716\u793a\uff08\u5e36\u6709\u5c0d\u89d2\u7dda\u7684\u7d05\u8272\u5716\u793a\uff09\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"588\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-92-1.webp\" title=\"\" width=\"1045\"\/><\/figure>\n<ul>\n<li>Gemini \u7684\u9078\u9805\u4e5f\u6703\u52a0\u5165\u5de6\u5074\u7684\u6d3b\u52d5\u6b04\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"580\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-93-1.webp\" title=\"\" width=\"1031\"\/><\/figure>\n<p>\u5c31\u662f\u9019\u6a23\u3002\u73fe\u5728\uff0c\u60a8\u53ef\u4ee5\u958b\u59cb\u5728 VS Code \u4e2d\u4f7f\u7528 Gemini \u4f86\u53d6\u5f97\u7a0b\u5f0f\u78bc\u7522\u751f\u8aaa\u660e\u6216\u8207\u5176\u804a\u5929\u3002<\/p>\n<h2 id=\"generating-code-with-gemini\">\u4f7f\u7528 Gemini \u7522\u751f\u7a0b\u5f0f\u78bc<\/h2>\n<p>\u82e5\u8981\u5728 VS Code \u4e2d\u4f7f\u7528 Gemini\uff0c\u60a8\u53ef\u4ee5\u6839\u64da\u63d0\u793a\u7522\u751f\u65b0\u7a0b\u5f0f\u78bc\u3001\u53d6\u5f97\u7de8\u78bc\u5efa\u8b70\u6216\u53d6\u5f97\u5167\u5d4c\u5efa\u8b70\u3002<\/p>\n<p>\u9996\u5148\uff0c\u6253\u958b\u8981\u4f7f\u7528 Gemini \u7684\u73fe\u6709\u61c9\u7528\u7a0b\u5e8f\uff0c\u6216\u70ba Cloud Code \u5efa\u7acb\u7bc4\u4f8b\u61c9\u7528\u7a0b\u5f0f\u4f86\u6e2c\u8a66 Gemini\u3002<\/p>\n<ul>\n<li>\u82e5\u8981\u5efa\u7acb\u7bc4\u4f8b\u61c9\u7528\u7a0b\u5e8f\uff0c\u8acb\u6309<code>Ctrl<\/code>+ <code>Shift<\/code>+ <code>P<\/code>(Windows\/Linux) \u6216<code>Cmd<\/code>+ <code>Shift<\/code>+ <code>P<\/code>(Mac) \u958b\u555f VS Code \u4e0a\u7684\u547d\u4ee4\u9762\u677f\u3002<\/li>\n<li>\u7136\u5f8c\uff0c\u8f38\u5165\u300c\u96f2\u7aef\u4ee3\u78bc\uff1a\u65b0\u61c9\u7528\u7a0b\u5f0f\u300d\u4e26\u6309 Enter \u9375\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"637\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-94-1.webp\" title=\"\" width=\"1132\"\/><\/figure>\n<ul>\n<li>\u5f9e\u9078\u9805\u4e2d\u9078\u64c7\u201cKubernetes \u61c9\u7528\u7a0b\u5f0f\u201d\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"579\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-95-1.webp\" title=\"\" width=\"1029\"\/><\/figure>\n<ul>\n<li>\u7136\u5f8c\uff0c\u5f9e\u9078\u9805\u4e2d\u9078\u64c7\u4e00\u500b\u7bc4\u4f8b\u61c9\u7528\u7a0b\u5e8f\uff0c\u4f8b\u5982\u201cPython (Flask): Guestbook\u201d\u3002\u8acb\u6ce8\u610f\uff0c\u5982\u679c\u60a8\u5c1a\u672a\u5b89\u88dd\u7bc4\u4f8b\u61c9\u7528\u7a0b\u5e8f\uff0c\u5247\u9700\u8981\u5b89\u88dd\u8a72\u8a9e\u8a00\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"636\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-96-1.webp\" title=\"\" width=\"1132\"\/><\/figure>\n<ul>\n<li>\u5c07\u61c9\u7528\u7a0b\u5f0f\u5132\u5b58\u5230\u60a8\u6240\u9700\u7684\u4f4d\u7f6e\uff0c\u7136\u5f8c\u5c07\u5efa\u7acb\u61c9\u7528\u7a0b\u5f0f\u3002<\/li>\n<\/ul>\n<p>\u5efa\u7acb\u61c9\u7528\u7a0b\u5f0f\u5f8c\uff0c\u5efa\u7acb\u4e00\u500b\u65b0\u7684\u7a0b\u5f0f\u78bc\u6a94\u6848\u6216\u958b\u555f\u73fe\u6709\u7684\u7a0b\u5f0f\u78bc\u6a94\u6848\u4ee5\u4f7f\u7528 Gemini\u3002\u4ee5\u4e0b\u662f Gemini \u53ef\u4ee5\u5e6b\u52a9\u60a8\u7522\u751f\u7a0b\u5f0f\u78bc\u7684\u5404\u7a2e\u65b9\u6cd5\u3002<\/p>\n<h3 id=\"get-in-line-suggestions\">\u53d6\u5f97\u7dda\u4e0a\u5efa\u8b70<\/h3>\n<ul>\n<li>\u8981\u7372\u5f97\u7dda\u4e0a\u5efa\u8b70\uff0c\u8acb\u958b\u59cb\u8f38\u5165\u4ee3\u78bc\u3002<\/li>\n<li>Gemini \u5c07\u5728\u60a8\u7de8\u5beb\u7a0b\u5f0f\u78bc\u6642\u70ba\u60a8\u63d0\u4f9b\u81ea\u52d5\u5b8c\u6210\u5efa\u8b70\u3002<\/li>\n<li>\u60a8\u53ef\u4ee5<code>Tab<\/code>\u6309\u63a5\u53d7\u5efa\u8b70\u3002\u82e5\u8981\u5ffd\u7565\u5efa\u8b70\uff0c\u8acb\u6309<code>Esc<\/code>\u6216\u7e7c\u7e8c\u7de8\u5beb\u7a0b\u5f0f\u78bc\u3002<\/li>\n<\/ul>\n<h3 id=\"generate-code\">\u7522\u751f\u7a0b\u5f0f\u78bc<\/h3>\n<ul>\n<li>Gemini \u9084\u53ef\u4ee5\u70ba\u60a8\u7522\u751f\u65b0\u7684\u7a0b\u5f0f\u78bc\u3002\u9ede\u9078 IDE \u8996\u7a97\u4e2d\u7684\u300cGemini\uff1a\u667a\u6167\u578b\u64cd\u4f5c\u300d\u5716\u793a\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"582\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-97-1.webp\" title=\"\" width=\"1035\"\/><\/figure>\n<ul>\n<li>\u7136\u5f8c\uff0c\u5f9e\u9078\u9805\u4e2d\u6309\u4e00\u4e0b\u300c\u751f\u6210\u7a0b\u5f0f\u78bc\u300d\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"589\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-98-1.webp\" title=\"\" width=\"1047\"\/><\/figure>\n<ul>\n<li>Gemini \u5c07\u6839\u64da\u60a8\u6a94\u6848\u4e2d\u5df2\u6709\u7684\u7a0b\u5f0f\u78bc\u70ba\u60a8\u7522\u751f\u65b0\u7a0b\u5f0f\u78bc\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"625\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-99-1.webp\" title=\"\" width=\"1110\"\/><\/figure>\n<h3 id=\"generate-code-with-prompts\">\u6839\u64da\u63d0\u793a\u7522\u751f\u7a0b\u5f0f\u78bc<\/h3>\n<p>\u60a8\u4e5f\u53ef\u4ee5\u5411 Gemini \u63d0\u4f9b\u63d0\u793a\u4ee5\u70ba\u5176\u7522\u751f\u7a0b\u5f0f\u78bc\u3002<\/p>\n<ul>\n<li>\u8f49\u5230\u7a0b\u5f0f\u78bc\u4e2d\u7684\u65b0\u884c\u4e26\u9375\u5165\uff0c<code>#<\/code>\u7136\u5f8c\u63d0\u793a\u8f38\u5165\u4ee3\u78bc\u3002\u4f8b\u5982\uff0c\u9375\u5165<code># Function to create a Cloud Storage bucket<\/code>\u4e26\u6309 Enter\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"587\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-100-1.webp\" title=\"\" width=\"1044\"\/><\/figure>\n<ul>\n<li>\u7136\u5f8c\uff0c\u8981\u7522\u751f\u7a0b\u5f0f\u78bc\uff0c\u8acb\u6309<code>Ctrl<\/code>+\uff0c<code>Enter<\/code>\u7121\u8ad6\u60a8\u4f7f\u7528\u7684\u662f Windows\u3001Linux \u9084\u662f Mac\u3002<\/li>\n<li>Gemini \u5c07\u6839\u64da\u60a8\u7684\u8acb\u6c42\u7522\u751f\u7a0b\u5f0f\u78bc\u3002\u6309<code>Tab<\/code>\u9375\u76e4\u63a5\u53d7\u5b83\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"596\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-102-1.webp\" title=\"\" width=\"1059\"\/><\/figure>\n<h2 id=\"chat-with-gemini\">\u8207\u96d9\u5b50\u5ea7\u804a\u5929<\/h2>\n<p>\u60a8\u4e5f\u53ef\u4ee5\u5728 VS Code \u4e2d\u8207 Gemini \u804a\u5929\u3002\u5b83\u53ef\u4ee5\u56de\u7b54\u554f\u984c\u3001\u5411\u60a8\u89e3\u91cb\u7a0b\u5f0f\u78bc\u6216\u5e6b\u52a9\u60a8\u4f7f\u7528\u6240\u9078\u7a0b\u5f0f\u78bc\u3002<\/p>\n<ul>\n<li>\u82e5\u8981\u8207 Gemini \u804a\u5929\uff0c\u8acb\u9ede\u9078\u5de6\u5074\u6d3b\u52d5\u6b04\u4e2d\u7684\u300cGemini\u300d\u5716\u793a\u3002 Gemini \u804a\u5929\u9762\u677f\u5c07\u5728\u5de6\u5074\u958b\u555f\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"645\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-104-1.webp\" title=\"\" width=\"1146\"\/><\/figure>\n<ul>\n<li>\u5728\u63d0\u793a\u6b04\u4e2d\u8f38\u5165\u60a8\u7684\u63d0\u793a\u4e26\u5c07\u5176\u767c\u9001\u5230 AI\uff08\u60a8\u7684\u4ee3\u78bc\u6a94\u6848\u61c9\u8a72\u70ba\u6b64\u6253\u958b\uff09\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u8aaa<code>Explain this code to me<\/code>. Gemini \u5c07\u4f7f\u7528\u60a8\u6587\u4ef6\u4e2d\u7684\u7a0b\u5f0f\u78bc\u4f5c\u70ba\u53c3\u8003\uff0c\u4e26\u70ba\u60a8\u63d0\u4f9b\u89e3\u91cb\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"776\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-105-1.webp\" title=\"\" width=\"1380\"\/><\/figure>\n<ul>\n<li>\u60a8\u4e5f\u53ef\u4ee5\u9078\u64c7\u6a94\u6848\u4e2d\u7684\u7a0b\u5f0f\u78bc\uff0c\u7136\u5f8c\u5c07\u63d0\u793a\u50b3\u9001\u7d66 Gemini \u4ee5\u89e3\u91cb\u8a72\u7a0b\u5f0f\u78bc\u3002\u7136\u5f8c\uff0c\u5b83\u53ea\u6703\u5728\u56de\u7b54\u60a8\u7684\u67e5\u8a62\u6642\u4f7f\u7528\u6240\u9078\u4ee3\u78bc\u4f5c\u70ba\u53c3\u8003\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"632\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-106-1.webp\" title=\"\" width=\"1123\"\/><\/figure>\n<ul>\n<li>\u60a8\u4e5f\u53ef\u4ee5\u8981\u6c42 Gemini \u70ba\u6574\u500b\u7a0b\u5f0f\u78bc\u6216\u804a\u5929\u9762\u677f\u4e2d\u9078\u5b9a\u7684\u7a0b\u5f0f\u78bc\u7522\u751f\u55ae\u5143\u6e2c\u8a66\u3002\u5728\u804a\u5929\u9762\u677f\u4e2d\u8f38\u5165\u5167\u5bb9<code>Generate unit tests<\/code>\uff0cGemini \u5c07\u70ba\u60a8\u7684\u6574\u500b\u7a0b\u5f0f\u78bc\u6216\u9078\u5b9a\u7684\u529f\u80fd\uff08\u6839\u64da\u60a8\u7684\u9078\u64c7\uff09\u7522\u751f\u55ae\u5143\u6e2c\u8a66\u3002<\/li>\n<li>\u540c\u6a23\uff0c\u60a8\u53ef\u4ee5\u5728\u804a\u5929\u9762\u677f\u4e2d<code>Help debug the code<\/code>\u8a62\u554fGemini\u3002<code>Make the code more readable<\/code>\u6839\u64da\u60a8\u5728\u63d0\u793a\u4e4b\u524d\u662f\u5426\u9078\u64c7\u4e86\u7a0b\u5f0f\u78bc\u7684\u4e00\u90e8\u5206\uff0c\u5b83\u5c07\u70ba\u60a8\u7684\u7a0b\u5f0f\u78bc\u7684\u4e00\u90e8\u5206\/\u6574\u500b\u7a0b\u5f0f\u78bc\u6a94\u6848\u63d0\u4f9b\u6240\u9700\u7684\u56de\u61c9\u3002<\/li>\n<\/ul>\n<h3 id=\"other-ways-to-access-gemini\">\u53c3\u89c0\u96d9\u5b50\u5ea7\u7684\u5176\u4ed6\u65b9\u5f0f<\/h3>\n<ul>\n<li>\u60a8\u4e5f\u53ef\u4ee5\u900f\u904e\u9ede\u64ca\u7a0b\u5f0f\u78bc\u7de8\u8f2f\u5668\u4e2d\u7684\u300c\u986f\u793a\u7a0b\u5f0f\u78bc\u64cd\u4f5c\u300d\u5716\u793a\uff08\u71c8\u6ce1\uff09\u4f86\u9078\u64c7\u7a0b\u5f0f\u78bc\u4e26\u4f7f\u7528 Gemini \u57f7\u884c\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"613\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-103-1.webp\" title=\"\" width=\"1091\"\/><\/figure>\n<ul>\n<li>\u60a8\u4e5f\u53ef\u4ee5\u5728 VS Code \u4e2d\u4f7f\u7528 Gemini \u57f7\u884c\u5176\u4ed6\u64cd\u4f5c\u3002\u5728 VS Code \u4e0a\u958b\u555f\u547d\u4ee4\u9762\u677f\u3002<\/li>\n<li>\u7136\u5f8c\uff0c\u8f38\u5165\u201cGemini:\u201d\uff0c\u5c31\u6703\u51fa\u73fe\u6709\u95dc\u5982\u4f55\u4f7f\u7528 Gemini \u7684\u9078\u9805\u3002\u4f60\u53ef\u4ee5\u8b93 Gemini \u5e6b\u4f60\u89e3\u91cb\u7a0b\u5f0f\u78bc\u3001\u5c08\u6ce8\u804a\u5929\u8996\u5716\u3001\u7522\u751f\u7a0b\u5f0f\u78bc\u3001\u751f\u6210\u55ae\u5143\u6e2c\u8a66\u7b49\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\" class=\"wp-image\" decoding=\"async\" height=\"668\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2024\/04\/image-107-1.webp\" title=\"\" width=\"1188\"\/><\/figure>\n<p>\u5c31\u662f\u9019\u6a23\u3002 Gemini Code Assist \u5e0c\u671b\u6210\u70ba GitHub Copilot \u7684\u6709\u529b\u7af6\u722d\u5c0d\u624b\uff0c\u5c24\u5176\u662f\u5b83\u64c1\u6709 100 \u842c\u500b\u4e0a\u4e0b\u6587\u8996\u7a97\u3002\u73fe\u5728\uff0c\u552f\u4e00\u5269\u4e0b\u7684\u4e8b\u60c5\u5c31\u662f Gemini Code Assist \u662f\u5426\u6703\u50cf\u7de8\u78bc\u4e00\u6a23\u9ad8\u6548\uff0c\u771f\u6b63\u6210\u70ba\u4e00\u500b\u6709\u7528\u7684\u5de5\u5177\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google\u6700\u8fd1\u5728\u62c9\u65af\u7dad\u52a0\u65af\u8209\u884c\u7684 Cloud Next \u6703\u8b70\u4e0a\u63a8\u51fa\u4e86 Gemini Code Assist\uff0c\u9019\u662f\u4e00\u6b3e\u4ee5\u4f01\u696d\u70ba\u5c0e\u5411\u7684\u4eba\u5de5\u667a\u6167\u7a0b\u5f0f\u78bc\u5b8c\u6210\u548c\u8f14\u52a9\u5de5\u5177\u3002 \u4ec0\u9ebc\u662f Gemini \u7a0b\u5f0f\u78bc\u5354\u52a9\uff1f\u60a8\u53ef\u4ee5\u5728 IDE\uff08\u4f8b\u5982 VS Code\u3001IntelliJ\u3001Cloud Workstations \u6216 Cloud Shell Editor\uff09\u4e2d\u4f7f\u7528 Gemini Code Assist \u4f86\u5354\u52a9\u958b\u767c\uff0c\u6216\u5728 Google Cloud Console \u4e2d\u4f7f\u7528\u5b83\u4f86\u8f14\u52a9\u6545\u969c\u6392\u9664\u3002 Gemini Code Assist \u53ef\u4ee5\u5e6b\u52a9\u60a8\u5728\u7de8\u5beb\u7a0b\u5f0f\u78bc\u6642\u5b8c\u6210\u7a0b\u5f0f\u78bc\uff0c\u5f9e\u8a3b\u89e3\u7522\u751f\u5b8c\u6574\u7684\u51fd\u6578\u6216\u7a0b\u5f0f\u78bc\u5340\u584a\uff0c\u7522\u751f\u55ae\u5143\u6e2c\u8a66\uff0c\u4e26\u5354\u52a9\u60a8\u5075\u932f\u3001\u7406\u89e3\u548c\u8a18\u9304\u7a0b\u5f0f\u78bc\u3002 \u5f9e\u6280\u8853\u4e0a\u8b1b\uff0c\u5b83\u662f Duet AI \u7684\u6f14\u8b8a\uff0c\u8c37\u6b4c\u5e7e\u500b\u6708\u524d\u505c\u6b62\u4e86 Duet AI\u3002\u7136\u800c\uff0c\u73fe\u5728\uff0c\u5b83\u66f4\u50cf\u662f\u5fae\u8edf GitHub Copilot \u7684\u76f4\u63a5\u7af6\u722d\u5c0d\u624b\uff0c\u5f8c\u8005\u662f\u53ef\u4ee5\u5e6b\u52a9\u60a8\u7de8\u78bc\u7684\u6700\u8457\u540d\u7684\u4eba\u5de5\u667a\u6167\u5de5\u5177\u4e4b\u4e00\u3002 Code Assist \u4f7f\u7528 Gemini 1.5 Pro\uff0c\u5b83\u64c1\u6709 100 \u842c\u500b\u4e0a\u4e0b\u6587\u7a97\u53e3\uff0c\u662f\u6240\u6709\u6a21\u578b\u63d0\u4f9b\u7684\u6700\u5927\u4e0a\u4e0b\u6587\u7a97\u53e3\u3002\u9019\u7d66 Code Assist \u5e36\u4f86\u4e86\u76f8\u7576\u5927\u7684\u512a\u52e2\u3002\u7528\u6236\u751a\u81f3\u53ef\u4ee5\u4f7f\u7528\u6b64\u4e0a\u4e0b\u6587\u8996\u7a97\u5c0d\u5176\u6574\u500b\u7a0b\u5f0f\u78bc\u5eab\u9032\u884c\u66f4\u6539\uff0c\u9019\u662f\u76ee\u524d\u5176\u4ed6\u5e73\u53f0\u7121\u6cd5\u63d0\u4f9b\u7684\u3002 \u516c\u53f8\u9084\u53ef\u4ee5\u6839\u64da\u5176\u5167\u90e8\u7a0b\u5f0f\u78bc\u5eab\u5fae\u8abf Code Assist\uff0c\u5c31\u50cf GitHub Copilot [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[181,199,129],"class_list":["post-1610","post","type-post","status-publish","format-standard","hentry","category-how-to","tag-artificial-intelligence","tag-gemini","tag-microsoft"],"acf":[],"_links":{"self":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/1610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/comments?post=1610"}],"version-history":[{"count":1,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/1610\/revisions"}],"predecessor-version":[{"id":1611,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/1610\/revisions\/1611"}],"wp:attachment":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/media?parent=1610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/categories?post=1610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/tags?post=1610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}